Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i am using C# web request in current case when textbox change page loaded i have url but problem is i don't know how pass parameter in this request this is the passing parameter passing to request this i got from firebug
pls help how to pass parameter to c# program here i go parameters are below.

now i am using post method i am also passing cookie to that post request my problem is i don't know how to pass other paramter. currently this web site using ajax for loading data this is called when textbox change event occur.
after analysis request using firebug i got this parameters i don't know how to pass this parameter to web request. i think the paramter WidgetList is a json

CSS
Parameters   application/x-www-form-urlencoded

Input   pg=2&curWSC=WSC
MetaKey  srp

PageData    
suffix=&baseurl=realestateandhomes-search&
amp;status=homes+for+sale&zip=50023&city=ANKENY&state=IA&statename=Iowa&type=single-family-home%3Bcondo-townhome-row-home-co-op%3Bmfd-mobile-home&listingType=single-family-home%3Bcondo-townhome-row-home-co-op%3Bmfd-mobile-home&nl=last14days&sby=2&sortby=2&userlocation=Ankeny%2CIA%2C50023&MetaKey=srp&seo_loc=Zip&PageTitle=50023+Real+Estate+-+ANKENY%2C+IA+50023+Homes+for+Sale+-+Realtor.com%26reg%3B+&PageH1=50023+Real+Estate+and+Homes+for+Sale&pagesize=10&baseHost=&mapConstructor=vemap&_rdcLibUrl=http%3A%2F%2Fstatic.move.com%2Flib%2Frdc%2F6.0.19%2F&svertical=rdc

WidgetList   
[{"ID": "currentProperty", "Param": "extras=status&ajax=0&DataAdapterKey=dat&WidgetRelative=%2FcurrentProperty", "Widget": "currentProperty", "WidgetRelative": "/currentProperty", "ctxt": "", "extraLoad": null}, {"ID": "oldSRP", "Param": "ajax=0&listingTypeDefault1=single-family-home&listingTypeDefault2=condo-townhome-row-home-co-op&listingTypeDefault3=mfd-mobile-home&statusDefault=sale&sortbyDefault=2&OmnitureUpdate=1&geo_server=geo.svc.move.com&showCustoimzeIndicator=1&srpFadeOutRate=0.5&listingDataSource=oldSRPHeader&DataAdapterKey=dat&ArgAdapterKey=argSRP&cookieName4RecentViewed=RecentViewed&cookieName4RecentSearch=RecentSearch&pageStatus=SRPWidget%7ColdSRP%7ColdSRPHeader&defaultSRPTab=oldSRPTab&statusWidget=oldFacetSearch&FacetLimit=20&extras=mlslid%7Cpfbm%7Ccity%7Cstate&WidgetRelative=%2FoldSRP", "Widget": "oldSRP", "WidgetRelative": "/oldSRP", "ctxt": "", "extraLoad": null}]
debug   0
format  jsonp
paramCookie []
Posted
Updated 23-Dec-11 23:20pm
v2

1 solution

Did you hear about difference between GET and POST requests? If no, please find information about it first. If yes and your only problem to write POST data to HttpWebRequest then here we go:
Send Data Using the WebRequest Class[^]

If I incorrectly understand your question, please provide more details.
 
Share this answer
 
v2
Comments
Aneesh M 24-Dec-11 5:20am    
now i am using post method i am also passing cookie to that post request my problem is i don't know how to pass other paramter. currently this web site using ajax for loading data this is called when textbox change event occur.
after analysis request using firebug i got this parameters i don't know how to pass this parameter to web request. i think the paramter WidgetList is a json
TimGameDev 24-Dec-11 6:15am    
AJAX request is the separate request on the page. Assuming that you need two requests, first to get AJAX data, the second request should contain "action" which happen when user do something on the page updated by AJAX. So, your questions is how to pass AJAX data to WebRequest for page. This should be done in the same way as Web Site does. So if it's pass data through query string do it in the same way, if it sends data in POST request do it in the same way. According to your quote from FiteBug site sends data through POST request. Well, if you correctly implement HttpWebRequest with POST method (like in the link in my answer) everything should work
Aneesh M 24-Dec-11 9:05am    
in this program i am passing parameters are below
Input
MetaKey
PageData
WidgetList
TimGameDev 25-Dec-11 9:02am    
I'm sorry, what do you expect to hear from me after your message? I lost my telepathy to get how you are doing this and where you got problem/error :) I recommend you to post your code here then everybody can understand what you're trying to do.

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