Shahid Mahmood Adil
Shahid Mahmood Adil

Reputation: 75

Link is not working Well

this is my link in my page

asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default.aspx">Add Record /asp:HyperLink

with VS2008 it is fine but with IIS it creates the problem like

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404.

my directory to view.aspx page and default.aspx page is same which library.

also the path changes form

http://localhost/library/View.aspx to http://localhost/Default.aspx

is anybody help me where the problem is ?

Upvotes: 0

Views: 109

Answers (1)

Noon Silk
Noon Silk

Reputation: 55082

Make the link

asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/library/Default.aspx">Add Record 

Instead of

asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default.aspx">Add Record 

The "~" gets the root folder for the application. You don't want that, you want the root + /library/ and then the page, Default.aspx.

Upvotes: 1

Related Questions