salem salah
salem salah

Reputation: 23

what is the difference between rawurl and query string?

i read about httphandler and they use rawurl and then they said : For example, suppose you rewrote the HTTP handler that processes image requests so that it is based on the query string instead of the file name

Upvotes: 1

Views: 1167

Answers (2)

salem salah
salem salah

Reputation: 23

HttpRequest.RawUrl Property Gets the raw URL of the current request.

see more http://msdn.microsoft.com/en-us/library/system.web.httprequest.rawurl(v=vs.110).aspx

html addresses use QueryString property to pass values between pages

http://www.localhost.com/Webform2.aspx?name=Atilla&lastName=Ozgur

Webform2.aspx this is the page your browser will go. name=Atilla you send a name variable which is set to Atilla lastName=Ozgur you send a lastName variable which is set to Ozgur

Upvotes: 0

Aristos
Aristos

Reputation: 66649

When you make a url rewrite the Request.RawUrl is shown the url that user see on the bar, there you do not have the query strings that you have rewrite.

For example if you rewrite the www.site.com/2/product to www.site.com/product.aspx?id=2 to been able to read the id you need to use the Query string, because the RawUrl did not have it.

Upvotes: 2

Related Questions