如何重命名我的asp.net网页 [英] How to Rename my asp.net web page
问题描述
我有XYZ.aspx页面名称
I have a page name with XYZ.aspx
现在我想改变我ABC.aspx应该怎么办呢?
Now I want to change ABC.aspx how should I do it?
当我直接从Solution Explorer中改变它给我一个错误。
When i directly change it from solution explorer it gives me an error.
任何人都可以帮助我在这?
Can anyone help me on this?
感谢您
Smartdev
推荐答案
总依赖于项目的类型和文件本身ASP.NET文件通常由1-3文件。话虽这么说,总有标记* .aspx文件,然后有选择地将有code-背后* .aspx.cs文件和一个额外的,也可选设计文件* .aspx.designer.cs。如果您重命名文件,你将需要更新在不同的地方code基于文件本身的结构。
ASP.NET files are usually composed of 1-3 files total depending on the type of project and the file itself. That being said, there is always the markup *.aspx file, then optionally there will be a code-behind *.aspx.cs file and an additional and also optional designer file *.aspx.designer.cs. If you are renaming the file you will need to update code in various places based on the structure of the file itself.
在超过1文件制作你的ASP.NET页面的情况下,你将要更新的.aspx文件的头,像这样:
In the event of more than 1 file making up your ASP.NET page you will want to update the .aspx file's header like so:
<%@Page CodeBehind="XYZ.aspx.cs" Inherits="XYZ" %>
到
<%@Page CodeBehind="ABC.aspx.cs" Inherits="ABC" %>
然后在文件后面code
Then in the code behind file
public partial class XYZ : Page { }
到
public partial class ABC : Page { }
最后,如果还有一个*了.Designer.cs文件,你会想对其进行更新:
Finally, if there is also a *.designer.cs file you will want to update it as well:
public partial class XYZ : Page { }
到
public partial class ABC : Page { }
这应该涵盖所有的文件!
That should cover all of the files!
这篇关于如何重命名我的asp.net网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!