c# - Umbraco Request.QueryString is null if it's the first time the page is loaded -
i have maddening problem (aren't all?).
i supporting umbraco 4.9.0 site experiencing issue querystring property on the request null, first time page loaded. example,
www.site.com/download.aspx?id=d99fe4df-28d9-4565-b444-b42499fcefd3
in code-behind, on page_load method, attempting id:
var id = request.querystring["id"];
this works except first time page loads. example, first time hit above url, id null. if hit url again, id set value you'd expect.
furthermore, if stop , restart web app via visual studio, id variable continues work expected. however, if modify code base @ (example below), again pass non-populated query string first time, , work after time that.
var test = "my modification test"; var id = request.querystring["id"];
i noticed request.urlreferrer null, request.url www.site.com/download.aspx.
any appreciated!
instead of
var id = request.querystring["id"];
try
var id = request["id"];
what does? try find request variable request object in order of
- querystring
- form
- cookies
- clientcertificate
- servervariables
it possible getting variable " form " post event ... in request.form["id"] .... , not in query string.
Comments
Post a Comment