Karthik N Karthik N - 1 year ago 70
ASP.NET (C#) Question

How to call page name as folder instead of pagename.aspx

I am having pages like


But I want like this


Answer Source

This is known as url re-writing in ASP.NET web forms and can be easily achieved by adding the following code to your Web.config file:

        <rule name="RewriteASPX">
          <match url="(.*)" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          <action type="Rewrite" url="{R:1}.aspx" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download