Aspx page as argument to page

It may seem crazy, but I have no choice leaving this question. One of the tester guys raised the question of where the page is passed as an argument to the same page, and it shows strange results.

The url looks like this: http: // localhost: 60729 / default.aspx / default.aspx Or also http: // localhost: 60729 / default.aspx / account.aspx

Now my question is to check this in the local environment, it shows that the resource was not found enter image description here BUT, if it is hosted on an IIS server, it does not show any resource errors. enter image description here

Why?? I missed some basic logic

+7
source share
1 answer

You can check the Routing (located at App_start) if you use the template. Check the URL of the page (click on the page in Solution Explorer and check the "Browse by URL" section in the properties. Check the properties, launch it on the page (tab "Project" → "Name Properties" → Internet → Start Action → Specific Page .) Check if it works and what the URL is. If it still doesn't work, I recommend editing the port. There are two ways to do this.

  • Go to the "Properties →" page and check / edit the localhost port (in the "Servers → project URL" section).
  • Click on your solution in Solution Explorer and check the URL in the properties window below.

If still not working: try editing the web.config file with this code:

<system.webServer> <defaultDocument> <files> <clear /> /* option 1 /* <add value="default.aspx/default.aspx" /> /* option 2 /* <add value="default.aspx" /> </files> </defaultDocument> </system.webServer> 

Also: why default.aspx / default.aspx? I think that the point in the first default may be a troublemaker.

EDIT

So, I recreated your page (without code) and here is the result: Your default re-created page

It works fine on the local host. HTML code:

 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> This is the default page<br /> Enter name:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <br /> Enter Age:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> </div> </form> </body> </html> 

I suggest, if nothing happens at all, to rebuild your project. This is the only way.

0
source share

All Articles