Pass parameters through URL in C# ASP.net
asp.net, c#
Solution
You dont need to add additional single quote in URL
string url = "Report_Classwise.aspx?classname=" + classname + "&teachername="
+ teachername;
Problem
I have the following code for a Button click event where I open a new Tab for a Report and I need to pass a parameter to that from the code behind, ``` String classname = txt_classname.SelectedValue; String teachername = "Some name"; string url = "Report_Classwise.aspx"; string s = "window.open('" + url + "', 'popup_window', 'width=300,height=100,left=100,top=100,resizable=yes');"; ClientScript.RegisterStartupScript(this.GetType(), "script", s, true); ``` I need to pass classname & teachername to Report_Classwise.aspx page, I have tried setting ``` string url = "Report_Classwise.aspx?classname='"+classname+"'&teachername='"+teachername+"'"; ``` But it didn't work