更改默认" Default.aspx的"到" Index.aspx的"在Visual Studio 2010中aspx、Default、QUOT、Index

2023-09-03 00:41:20 作者:市井的喧嚣声都温柔

每当我创建Visual Studio 2010的一个新的Web窗体,默认的名称是始终的Default.aspx。这是一个轻微的疼痛,我不得不将其更改为Index.aspx的各一次。

Whenever I create a new Web Form on Visual Studio 2010, the default name is always "Default.aspx". This is a slight pain as I'm having to change it to "Index.aspx" each time.

我怎样才能改变这种使的Index.aspx是默认的名字?

How can I change this so that "Index.aspx" is the default name?

感谢。

推荐答案

您可以通过修改相关.vstemplate的 defaultName中元素。例如,你可能会发现你需要类似于以下的目录修改网络表单模板:C:\ Program Files文件\微软的Visual Studio 10.0 \ Common7 \ IDE \的ItemTemplate \ CSHARP \网络\ 1033。每个模板文件中像WebForm.zip一个zip文件管理。解压缩的内容,修改.vstemplate defaultName中的元素,并重新应用更改到相同的模板文件夹。你的更新应该反映在Visual Studio中。 (您可能需要重新启动VS。)

You can by modifying the associated .vstemplate DefaultName element. For example, you might find the webform template you need to modify in a directory similar to the following: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web\1033. Each template file is managed within a zip file like WebForm.zip. Unzip the contents, modify the .vstemplate DefaultName element and reapply the changes to the same templates folder. Your updates should be reflected in Visual Studio. (You might need to restart VS.)

作为一种替代方法,您应考虑创建自己的模板(以关原),而不是修改默认模板。

As an alternative, you should consider creating your own template (based off the original) instead of modifying the default template.