Reputation: 53
Ok, I have a silly question to ask. I have to get this page with a jquery function and fill a dropdown list with data in an asp.net form. Any ideas or examples?
Upvotes: 0
Views: 193
Reputation: 900
I would do it indirectly using a page method in your codebehind, not directly using jquery due to being blocked by x-site scripting protection.
I'd write a simple class which uses a webclient in .net to pull the page contents back and parse the response into a List<string>
and return to your control somehow. Depending on if you're using jquery/jscript or an updatepanel in ASP.net, you can call the class method from within your code behind method to prevent a full postback and bind/populate your dropdown list with the data.
Example code is in the response marked answered in this previous post.
Upvotes: 1
Reputation: 836
Cross site scripting is blocked by most browsers. You could use jsonp dataype in your ajax request but the target link don't provide this data type. So, -probably- not possible with javascript.
Upvotes: 0