I'm posting data to a page called process.aspx that handles some business logic with the following code:
<%@ Page Language="C#" %>
<%
MyData.process(Request);
Response.Redirect("")
%>
this page I will be calling from a variety of pages. Is there some way of knowing from which page my form was submitted? I was thinking something along the lines of writing:
<form id="frmSystem" method="post" action="process.aspx?page=<%= %>">
However I don't know what to write in between the <%= %>
to get the current page name. Can anyone help please?
You can capture the calling page URL and hold it in
Session
orViewState
for later use.For example, in
Page_Load
,And then in your final event (perhaps Savebutton_Click or CloseButton_Click), you can do a redirect in either of these ways:
or
You can also get the URL of the calling page this way: