Look at the picture first (only the part is intercepted)
This is the mobile phone end user Personal Center user click can go to the corresponding module such as Click Collection:
-----------------------------
Go to this page and click on the house to go to the details page of the house:
Because there are multiple entrances to the details page of the House (homepage list, news, comments, collections, reminders, etc.) so the above return cannot be written dead, (my side of the return is <a> tag)
My idea is to get information about the last requested URL by request.urlreferrer this property :
The code is as follows: Page load Judging this is not empty
1 //return to previous page2 protected stringReturnUrl;3 protected voidPage_Load (Objectsender, EventArgs e)4 {5 if(!IsPostBack)6 {7 //return to previous page8 if(request.urlreferrer!=NULL)9 {TenRETURNURL =Request.UrlReferrer.ToString (); One } A Else - {
If empty, return to home page -RETURNURL ="Default.aspx"; the } - } -}
This is the front desk that the <a> tag href will not have to write dead, as long as the RETURNURL to assign the value
1 <ahref= "<%=returnUrl%>"><imgsrc= "Img/iconfont-back.png"alt=""class= "Menu_btn" /></a>2 3 <imgsrc= "Img/gengduo.png"alt=""class= "User_btn" />
Webfrom let the page return to the previous page