简体   繁体   中英

Links not working after deploy the web application in IIS 7.5

The Links not working in IE 9 after deploy the web application (developed in VS 2010, ASP.NET 4.0) in IIS 7.5. But in my development system the web application working fine. I deploy the web application by refer the site www.shubho.net/2011/01/quick-deployment-of-aspnet-applications.html

I gave path like this

<tr>
    <td colspan="2" align="center" class="style3">
        For new Registration please <a href="~/UserInfo.aspx">Click here</a> 
    </td>
</tr>

I gave the link like this in my first page. But when i click the Link, the following error displayed. I tried "../UserInfo.aspx" also.

The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.

Please review the following URL and make sure that it is spelled correctly.

Requested URL: /UserInfo.aspx


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

What if you specify an absolute path for the link?

/UserInfo.aspx

It sounds like for some folders, the UserInfo.aspx page isn't contained in them.

The tilde ~ has special meaning only to ASP.Net controls. It's a shortcut (or placeholder) to the application root and is replaced by the framework with the correct path. It has no meaning in "plain html".

Your link above is a standard HTML a tag (anchor tag) .

If you want to make your HTML a tag an ASP.Net (HTML) server control, you have to give it id and runat="server" attributes. Then it will "understand" what the tilde means.

Alternatively, as the prior answer states, remove the tilde ~ and simply provide the appropriate document or root relative link to the resource.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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