Click here to Skip to main content
15,891,763 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more: (untagged)
Can any one tell me how can i get value from query string in web service.
Posted
Comments
JeevanKumar777 13-May-13 7:12am    
hai gdevening,
can u help me by giving the solution of inserting data in database using webservice and after inserting the data how to display the fields in the url using querystring plz help me

XML
<ajaxToolkit:CascadingDropDown ID="ddlCollegeNameCascadingDropDown" runat="server" Category="RC" TargetControlID="ddlRC" LoadingText="Loading Regional Center..." PromptText="--Select Regional Center--" PromptValue="0" ServiceMethod="BindRCdropdown" ServicePath="../WebService/DropdownWebService.asmx"></ajaxToolkit:CascadingDropDown>

use ServiceMethod="BindRCdropdown" in code behind rather than apx page like
C#
ddlCollegeNameCascadingDropDown.ServiceMethod = "BindCollegedropdown?CRS=" + Request.QueryString["CRS"];

in web service call to get your QueryString
C#
strUGPG= HttpContext.Current.Request.QueryString["CRS"].ToString().Trim();



Thanks
 
Share this answer
 
Comments
AshishChaudha 19-Jul-12 5:39am    
Trying your self is a good habbit and sharing after getting solution is more than that...
Have a look at this stackoverflow question that explains what you need to do, (answer by Scott Anderson)

http://stackoverflow.com/questions/2006828/possible-to-invoke-asmx-service-with-parameter-via-url-query-string[^]

If you *really* need to allow HttpGet to your webservice, then you will be able to access the query string as in the example.

However, this does violate the pattern somewhat, if you need to allow HttpGet then consider creating a REST service, as per the accepted answer on that link

http://www.techbubbles.com/wcf/wcf-and-rest/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900