I have three pages calculator1.aspx, calculator2.aspx and Menu.aspx. On each page of the calculator, I have a button that redirects me to the menu page and to the menu page, I must return to the page Calculator1 or calculator2, from where the request was initiated. So how can I distinguish from which page my request will come in when im is on the menu page.
It is best to check the title HTTP_REFERER. It can be faked, but more often than not it will be enough.
HTTP_REFERER
string referer = Request.ServerVariables["HTTP_REFERER"];
URL.calulator1.aspx write
Response.Redirect('menu.aspx?page=cal1')
calulator2.aspx write
Response.Redirect('menu.aspx?page=cal2')
You can use the property Page.PreviousPageto get the page passed by the control to the current page.Or using the property HttpRequest.UrlReferrerto retrieve the URL information of a previous client request associated with the current URL.
Page.PreviousPage
HttpRequest.UrlReferrer
[Link]Page.PreviousPageHttpRequest.UrlReferrer
Source: https://habr.com/ru/post/1753991/More articles:why error messages do not appear in zend_form if validation fails? - zend-frameworkHow can I get a list of all mp3 files on an SD card regardless of the directory in android? - androidASP.NET MVC 2 Model Validation (DataAnnotes) in a Subobject - validationкак перевести шаблон электронной почты в magento? - magentoHow to make my private class visible to STD containers? - c ++Invalid behavior of std :: map insert - c ++How can I make Ubuntu Firefox web pages look like Windows / Mac Firefox? - firefoxImport large amounts of data into Google App Engine datastore at a time - pythonPHP getter / setter for an array - oopRational Software Architect: Converting UML to Java: Building Java Source Code - javaAll Articles