C#Web请求在Ajax中不起作用 [英] C# web request not worked in ajax

查看:57
本文介绍了C#Web请求在Ajax中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在当前情况下,当加载文本框更改页面时,我正在使用C#Web请求,我有url,但问题是我不知道此请求中的pass参数如何,这是我从萤火虫得到的请求传递的传递参数
请帮助如何将参数传递给C#程序,这里我去的参数如下.

现在我正在使用post方法,我也将cookie传递给该post请求,我的问题是我不知道如何传递其他参数.当前,此网站使用ajax加载数据,这在发生文本框更改事件时被调用.
使用Firebug进行分析请求后,我得到了此参数,但我不知道如何将此参数传递给Web请求.我认为参数WidgetList是一个json


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

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 []

推荐答案

您是否听说过GET和POST请求之间的区别?如果否,请先查找有关它的信息.如果是,并且是将POST数据写入HttpWebRequest的唯一问题,那么我们开始:
使用WebRequest类发送数据 [
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.


这篇关于C#Web请求在Ajax中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆