Hi,
I am re-writing the 404 error page for my site to offer a more attractive error state. I have set up IIS so that 404's point to a file /error/404.aspx - this works fine
In this page (404.aspx) I parse the querystring to extract the url that was typed (or linked to) and display this value in a textbox (vm_redirect.Text = parsedURL) - this also works fine.
There is a submit button available to the user, if they want to retry the page (or can amend string)
The code for the section embeds the button and textbox within a form
I also have my sub fn - redirectForm - this should redirect the user to the new page
This however causes a file not found error - if i view the source of the page, the form's action is
Is there any way i can prevent this from happening - so that any 404 leads to /error/404.aspx, but then when the user clicks 'go' - it tries to redirect to the string they have entered
Many thanks in advance
Boro
I am re-writing the 404 error page for my site to offer a more attractive error state. I have set up IIS so that 404's point to a file /error/404.aspx - this works fine
In this page (404.aspx) I parse the querystring to extract the url that was typed (or linked to) and display this value in a textbox (vm_redirect.Text = parsedURL) - this also works fine.
There is a submit button available to the user, if they want to retry the page (or can amend string)
The code for the section embeds the button and textbox within a form
<form runat="server" id="redirectFormId">
<asp:textbox id="vm_redirect" size="50" runat="server" />
<asp:button id="vm_submit" text="Go" OnClick="redirectForm" runat="server" EnableViewState="false"/>
</form>
I also have my sub fn - redirectForm - this should redirect the user to the new page
Sub redirectForm(ByVal vm_src As Object, ByVal vm_args As EventArgs)
Response.Redirect((vm_redirect.Text).ToString())
End Sub
This however causes a file not found error - if i view the source of the page, the form's action is
action="404.aspx?404;
Is there any way i can prevent this from happening - so that any 404 leads to /error/404.aspx, but then when the user clicks 'go' - it tries to redirect to the string they have entered
Many thanks in advance
Boro