Reputation: 51
i have done asp.net web application. In this administrator have rights to create new web page dynamically and delete it. After creating the page, user can see that page. if administrator delete a page and at the same time user is viewing that page, USER CAN'T ABLE TO REDIRECT TO ANOTHER PAGE. for example administrator created a test.aspx. if administrator deleted test.aspx page in ftp while user is viewing that test.aspx page, if at the same time user wants to navigate TO ANY ANOTHER PAGE, it displays error "test.aspx does not exist".
Upvotes: 2
Views: 212
Reputation: 4650
Try deleting the page (test.aspx), just before executing the Response.Redirect from the test.aspx page... not immediately after displaying the page... I have not created pages like this... But this is just a thought.
Upvotes: 0
Reputation: 16196
As you have specified that the problem is in navigating to any other page
just replace your asp.net link button or button to a simple asp server hyperlink or a plain html hyperlink and point it to the other page
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl="~/OtherPage.aspx">Navigate To Page 2</asp:HyperLink>
OR
<a href="OtherPage.aspx"></a>Navigate To Page 2</a>
Upvotes: 2
Reputation: 250932
This is because your ASP.NET application does everything using a POST-BACK mechanism. So when you click on an element with runat="server" attribute set, the page posts back to itself in order to find out what to do with that click.
In your case, it needs test.aspx to still exist in order to determine what to do with the click - as it isn't a simple hyperlink.
Upvotes: 1