0

I've decided to convert a Windows Phone 7 app that fetches an XML feed and then parses it to an asp.net web app, using Visual Web Developer Express. I figure since the code already works for WP7, it should be a matter of mostly copying and pasting it for the C# code behind.

HttpWebRequest request = HttpWebRequest.CreateHttp("http://webservices.nextbus.com/service/publicXMLFeed?command=routeConfig&a=sf-muni&r=" + line1);

That's the first line of code from my WP7 app that fetches the XML feed, but I can't even get HttpWebRequest to work in Visual Web Developer like that. Intellisense shows a create and createdefault, but no CreateHttp like there was in Windows Phone 7. I just need to figure out how to fetch the page, I assume the parsing will be the same as on my phone app. Any help?

Thanks,

Amanda

1

3 Answers 3

0

This must be easier to use.

WebClient client = new WebClient(); String htmlCode = client.DownloadString("url");

Sign up to request clarification or add additional context in comments.

Comments

0

Just call WebRequest.Create().
You may need to cast the result to HttpWebRequest.

Note that the WebClient class makes this much easier.

Comments

0

I have used the Asp.Net Rss Toolkit found here: http://aspnetrsstoolkit.codeplex.com/ It is a neat tool that will allow you to consume rss feeds. You can use their command line interface to create your c# or vb.net class with all of the property of your feed, therefore you don't have to parse anything. I totally recommend it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.