KyLim KyLim - 3 months ago 15
ASP.NET (C#) Question

Window location to another page with parameters

string parameter = Request.QueryString["forum_id"];

ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Replied!Thank you.');window.location ='eforum_main.aspx?forum_id='+parameter;", true);


I'm tried to add parameter when redirect but fail,no idea where i did wrong,my page didn't redirect to that page after i submit my data.

Answer

You are not using the parameter string correctly in the ScriptManager.

ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Replied!Thank you.');window.location ='eforum_main.aspx?forum_id=" + parameter + "';", true);