Location.Replace("URL") is not working for server controls like
Here is my code.
protected void _btn2_Click(object sender, System.EventArgs e)
{
string URL="http://forums.csharpcorner.com/AddPost.aspx?TSource=AddPost";
string func="";
func += "";
if(!IsClientScriptBlockRegistered("window.location.replace"))
{
Page.RegisterClientScriptBlock("window.location.replace", func);
}
}
It is redirecting to the new location, but the "Back" button in the browser is getting enabled.
I dont want this button to be enabled.
But the same location.replace("URL") is working for HTML buttons.
How we can make it possible in Server controls??
Any idea?
Regards,
Syed.
Replies
Know the answer? Post it — somebody with the same question will find it here.