asp.net query string parameter
-
2012年3月31日 5:57
I am new in ASP.net
I see some website using query parameter for example (http://hostname/path.aspx?name=a&phone=45)
I understand this parameter. but I dont understand (http://hostname/path.jpg?a=x&b=y or http://hostname/path.cssx?a=x etc)
how can I use query parameter in jpg, cssx, jssx, or another extension file in ASP.Net
KishanMundha
全部回复
-
2012年3月31日 9:14
Hello,
Post this question of "Forums.asp.net" for better response.
-
2012年3月31日 11:34
[...] I dont understand (http://hostname/path.jpg?a=x&b=y or http://hostname/path.cssx?a=x etc)
how can I use query parameter in jpg, cssx, jssx, or another extension file in ASP.Net
The "standard" mechanisms that you usually employ in asp.net will not let you execute code when it is serving a jpg or other "non-active-page" piece of data, and therefore there is no opportunity for you to process those parameters. However, you could trick the engine into running your code instead of having the conventional behavior when such a request is received. One way to do it is to add an HttpModule and perform some URL rewriting. Take a look at this article:
http://msdn.microsoft.com/en-us/library/ms972974.aspx
But anyway, this is not something that you want to discuss in the Training and Certification Forum. As a previous message already suggested, a good place to talk about this subject would be the asp.net forums:
- 已标记为答案 Mr. WhartyMicrosoft Community Contributor, Moderator 2012年4月1日 1:11
-
2012年4月1日 1:13版主
Hi Kishan,
Alberto has provided you with an answer and because I can't move your question to http://forums.asp.net/, I have marked his reply as the answer. You should however post a follow-up question in the http://forums.asp.net/ forum.
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer
Jeff Wharton
MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCSD, MCITP, MCDBA
Blog: Mr. Wharty's Ramblings
Twitter: @Mr_Wharty
MC ID: Microsoft Transcript