简体   繁体   English

Home.aspx页面的网址自动转换为Default.aspx

[英]Url of Home.aspx page automatically convert to Default.aspx

I am developing a web application webform project. 我正在开发一个Web应用程序webform项目。 I have few web forms in it. 我的网页表单很少。 I have some anchor elements that are performing redirection of pages. 我有一些执行页面重定向的anchor元素。 First let me show you the structure of my project: 首先让我向您展示我的项目的结构:

在此处输入图片说明

I am trying to navigate to Customer/Home.aspx page from Login.aspx Page. 我试图从Login.aspx页面导航到Customer / Home.aspx页面。 The issue I get is it automatically converts Home.aspx to Default.aspx. 我得到的问题是它将自动将Home.aspx转换为Default.aspx。 Here is how it resolves the Url: 这是解析网址的方法:

在此处输入图片说明

And here is the html I am using: 这是我正在使用的html:

<ul>
    <li><a href="Customer/Home.aspx">Customer</a></li>
    <li><a href="Products/Home.aspx">Products</a></li>
    <li><a href="Customer/SalesOrder.aspx">Sales Order</a></li>
    <li><a href="About/About.aspx">About</a></li>
</ul>

How should I resolve these urls correctly? 如何正确解析这些网址?

UPDATE I already have tried to use the LinkButton control but the Issue remains the same: 更新我已经尝试使用LinkBut​​ton控件,但是问题仍然相同:

<li>
    <asp:LinkButton ID="lnk" PostBackUrl="~/Customer/Home.aspx" runat="server">Customer</asp:LinkButton>
</li>

based on my experience I'm providing you with the following solutions. 根据我的经验,我为您提供以下解决方案。

  1. The solution can sometimes be simple. 解决方案有时可能很简单。 Just try the clear the browser catch files. 只需尝试清除浏览器捕获文件即可。
  2. Right click on the start up web form (in your case guess it's 'Login.aspx') and click 'Set as start Page' before compiling. 右键单击启动的Web表单(在您的情况下,猜测为“ Login.aspx”),然后在编译之前单击“设置为起始页”。
  3. Try to place '../' before the url like (../Customer/Home.aspx). 尝试在网址(../Customer/Home.aspx)之前放置“ ../”。 But this cannot be the issue unless you're trying to redirect from inside a directory. 但这不是问题,除非您尝试从目录内部进行重定向。

Please do reply me if this didn't solve your problem and check the URL on the HTML source code of your page, try to attach a screenshot if possible. 如果这样做不能解决您的问题,请回复我,并检查页面HTML源代码上的URL,如果可能,请尝试附加屏幕截图。

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

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