Need help on query string in asp.net

I have a create-quote.aspx page. I want to open this page in different modes, depending on whether the querystring parameter is present or not.

My question is which event should be checked if I have a querystring parameter or not. I think it should be despised what you say.

+4
source share
3 answers

Probably the best choice is to handle them on the Page_Load event:

http://msdn.microsoft.com/en-us/library/ms178472.aspx#lifecycle_events

+8
source

You're right. You must check the request in the preinit event. Before initialization, the start phase begins, where request request objects are created.

Link: http://msdn.microsoft.com/en-us/library/ms178472.aspx

0
source

I would check that there is something like this in the Page_Load event:

Page_Load { if(!Page.IsPostback) { if(Request.QueryString["id"] != null) { // do whatever with the id value } } } 
0
source

Source: https://habr.com/ru/post/1309664/


All Articles