i have 4 pages in aspx. page A, B , C, D. if i go from pageA to Page B then after clicking submit on PageB its should goto PageC and open Page D in a new window at same time. but if i go directly to PageBand click submit then it should only goto PageC and not open PageD in new window. i am using /?dest=pageD.aspx in querystring but it wont work. How can i acheive this?
+1
A:
Why use query string? Use PostBackUrl on the submit button. You can set it dynamically depending on the breadcrumb of your choice (ViewState/Session/Whatever), and then you'll still have access to controls via Page.PreviousPage.*. You could even use an injected javascript method to cause the current page to post back but to open a window in the background onclick.
You could even have the breadcrumb in the query string I guess.
if(Request.QueryString["PageVisit"] == "A") {
this.btnSubmit.PostBackUrl = "c.aspx";
this.btnSubmit.Attributes.Add("onclick","javascriptOpenWindowFunc();");
}
Joel Etherton
2010-01-19 01:46:52