Chris
Chris

Reputation: 1

Start Page as default aspx

I hosted a website using VS2012. My problem is the Home page is not specified by default whenever I access the website. Pleases would you mind to show me how to add Default.aspx or Home.aspx into my Web.config so as I can edit it.

 <configuration>
     <system.web>
      <compilation debug="true" targetFramework="4.5">
         <assemblies>
           <add assembly=""/>
            <add assembly=""/>
           <add assembly=" "/>
         </assemblies>
     </compilation>
    <httpRuntime targetFramework="4.5"/>
   </system.web>
</configuration>

Upvotes: 0

Views: 223

Answers (3)

Ricardo Nascimento
Ricardo Nascimento

Reputation: 36

Well, just go to webconfig and add it:

<configuration>
   <system.webServer>
        <defaultDocument>
          <files>
            <clear />
            <add value="Path of your Page" />
          </files>
        </defaultDocument>  
   </system.webServer>
</configuration>

Upvotes: 0

mason
mason

Reputation: 32728

In VS, you configure that by right clicking the web project, clicking Properties, going to the Web tab, and specifying a Specific Page for Start Action.

Note that this setting doesn't get set in Web.Config, and doesn't carry over when you deploy to IIS. You'd handle the default page within IIS Manager by setting the Default Document for your site.

Upvotes: 1

Arthur Castro
Arthur Castro

Reputation: 585

You can right click the .aspx file you want to be default in visual studio, and then "Set as Start Page".

Upvotes: 1

Related Questions