HtmlPage.Document.QueryString
protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack){ if (Request.QueryString["param"] != null) { //If it exists Response.Write(Request.QueryString["param"]) } else{ //If it is not existing } } }
string s = Request.QueryString["id"] as string; if(s != null) { //you have a query string with name ID, do something } else { //nope, there is no query string names id here, do something else }
if (Request.QueryString.ToString().Length >0) { //Request.QueryString is exist }
Uri uri = new Uri(Request.RawUrl); if(uri.Query.Length>0)
using System; using System.Web.UI; public partial class _Default : Page { protected void Page_Load(object sender, EventArgs e) { string v = Request.QueryString["param"]; if (v != null) { Response.Write("param is "); Response.Write(v); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)