简体   繁体   English

aspx页面作为页面的参数

[英]aspx page as an argument to a page

It may sound crazy but i have no choice else posting this question. 这可能听起来很疯狂,但我别无选择地发布这个问题。 One of a tester guy has raised a question where page is passed as an argument to the same page and it shows weird results. 一个测试人员提出了一个问题,其中页面作为参数传递到同一页面,它显示了奇怪的结果。

url look like this: http://localhost:60729/default.aspx/default.aspx Or also http://localhost:60729/default.aspx/account.aspx url看起来像这样: http:// localhost:60729 / default.aspx / default.aspx或者http:// localhost:60729 / default.aspx / account.aspx

Now my question is while testing this on local environment it shows resource not found 现在我的问题是在本地环境中测试它时显示未找到资源 在此输入图像描述 BUT when hosted on IIS server then it does not show any resource error. 但是当在IIS服务器上托管时,它不会显示任何资源错误。 在此输入图像描述

Why?? 为什么?? Am i missing some basic logics 我错过了一些基本的逻辑

You can check the Routing (located in App_start) if you are using a template. 如果您使用的是模板,则可以检查路由(位于App_start中)。 Check the URL of the page (Click on the page in the Solution Explorer and check the "Browse to URL" section in the properties. Check the properties, let it start at the page (Project tab -> "Name" Properties -> Web -> Start Action -> Specific Page.). Check if it works also what the URL is. If still not working, I recommend is editing the port. This can be achieved in 2 ways. 检查页面的URL(单击解决方案资源管理器中的页面,然后选中属性中的“浏览到URL”部分。检查属性,让它从页面开始(项目选项卡 - >“名称”属性 - > Web - >开始操作 - >特定页面。)。检查它是否也适用于URL。如果仍然无法工作,我建议编辑端口。这可以通过两种方式实现。

  1. Go to the Properties -> Web page and check/edit the port of localhost (under Servers -> Project URL) 转到属性 - > Web页面并检查/编辑localhost的端口(在Servers - > Project URL下)
  2. Click on your solution in the Solution Explorer and check the url in the properties window below. 在解决方案资源管理器中单击您的解决方案,然后在下面的属性窗口中检查URL。

If still not working: Try editing the web.config file with this code: 如果仍然无效:尝试使用以下代码编辑web.config文件:

 <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? 另外:为什么default.aspx / default.aspx? I think the dot in the first default could be the troublemaker here aswell. 我认为第一个默认点中的点也可能是麻烦制造者。

EDIT 编辑

So I re-created your page (no code-behind) and here's the result: 所以我重新创建了你的页面(没有代码隐藏),这是结果: 您重新创建的默认页面

It works on localhost perfectly. 它完全适用于localhost。 HTML code: HTML代码:

 <!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 works at all, to rebuild your project. 我建议,如果没有任何工作,重建你的项目。 That's the only way now. 这是现在唯一的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM