c# - Replace Query String of a page -


i want replace query string of page this-

firstly move page on clicking on menu bar items setting url- response.redirect("searchtworkforcereport.aspx?page=search");

then want change url this-

"searchtworkforcereport.aspx?page=search" "searchtworkforcereport.aspx?page=edit" on check box change event. try code-

 string strquerystring = request.querystring.tostring();  if (strquerystring.contains("page"))  {      strquerystring = strquerystring.replace("search", "edit");  } 

and it'll replace query string on page load if query string should give again previous set string.

type = request.querystring["page"].tostring(); 

you can't edit query string of page editing request.querystring. should redirect current page. use code below:

 if (request.rawurl.contains("page"))  {      response.redirect(request.rawurl.replace("search", "edit"))  } 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -