Click here to Skip to main content
15,904,415 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to open the url in same window and in same tab or we can say want to replace current page with url??

C#
String url = context.Activities.Where(a => a.ID == activityID).FirstOrDefault().ReportUrl + "?panachayatLocationId=" + panchayatRajLocationID + "&startDate=" + startDate.ToShortDateString() + "&endDate=" + endDate.ToShortDateString() + "&isPrint=true&isOffice=";
                    
url += ddlViewType.SelectedValue == "1" ? false : true;

url += "&status=" + ddlStatus.SelectedValue;

String strscript = "<script language=javascript>window.open('" + url + "');</script> btnEnter.OnClientClick = "window.location.href(\"" + url + "\")";
if (!ClientScript.IsStartupScriptRegistered("clientScript"))
                        ClientScript.RegisterStartupScript(Page.GetType(), "clientScript", strscript);
Posted
Updated 29-Aug-13 1:08am
v3

window.open("www.youraddress.com","_self")
 
Share this answer
 
in C#:
C#
Response.Redirect(url);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900