473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to call aspx page from C#

Hello,

I am forming a aspx url with query string parameters as variables.

sUrl = "http://abcd.com/getresults.aspx?zipcode=" + zipcode +
"&areaCode=" + areacode + "&Landmark=" + landmark;

When this url formed is run in IE, it returns an xml in the browser.
Now I want to duplicate this functionality in my code (like invoking
this url from within a function and getting the xml as output from the
function) so that my code can parse the xml got in return.

Kindly suggest a way in which this can be achieved?

Thanks in advance,

Sudeep

Nov 23 '05 #1
1 5970


su*************@gmail.com wrote:

sUrl = "http://abcd.com/getresults.aspx?zipcode=" + zipcode +
"&areaCode=" + areacode + "&Landmark=" + landmark;
Now I want to duplicate this functionality in my code (like invoking
this url from within a function and getting the xml as output from the
function) so that my code can parse the xml got in return.


Well there are lots of ways to parse XML in .NET and all should allow
you to pass in your sUrl, you can use an XmlTextReader e.g.
XmlTextReader xmlReader = new XmlTextReader(sUrl)
or you can use an XPathDocument e.g.
XPathDocument xPathDocument = new XPathDocument(sUrl);
or you can create an XmlDocument instance and use the Load method
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(sUrl);
It depends on what you want to do, XmlTextReader allows forwards only
pull parsing pulling in node by node and consuming not much resources
that way.
XPathDocument builds a read only tree model for the whole document
allowing for XPath navigation.
XmlDocument builds a DOM tree model for the whole document allowing
changes to contents and structure.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matthew Louden | last post by:
I want to provide date selection in a page. Basically I want to have similar effect as DTPicker in Visual Basic. My idea is to create a calendar control in mycalendar.aspx. Then I create a...
7
by: moondaddy | last post by:
I have a products catalogue that I'm putting online and there will be between 20 to 50 different pages of products. Each page contains a datagrid of products for a given category. However, the...
2
by: moondaddy | last post by:
I'm using vb.net and have an aspx page where I want to call a function in the code behind to do something on the backend and I want to call this function from a jscript function in the aspx page. ...
6
by: grist2mill | last post by:
I want to create a standard tool bar that appears on all pages that is a control. The toolbar has a button 'New'. What I wolud like when the user clicks on 'New' depends on the page they are on. I...
3
by: Patrick.O.Ige | last post by:
I created a USERCONTROL and i want to call a LABEL from an ASPX page. The USERCONTROL is in the ASPX page I have the label :- Label lblstr = new Label(); And displaying using:-...
2
by: engwar1 | last post by:
I have a page that my users will go to to upload files to my website. As I want to reuse the file upload code on multiple pages I put the file upload textbox/buttons on a user control which I plan...
1
by: MadHatter51 | last post by:
I have an application where a selection is made from a list on a web page. I have written a class to handle some database processing and then wish to pass a bunch of data objects to another web...
3
by: KaNos | last post by:
Hi, "robot script pages" are html+javascript pages, can be played in aspx player. So in this tech, robot call aspx player's function (an interface is sheared) and wait a result synchronously with...
1
by: thirunavukarasukm | last post by:
I have a link wich opens a the second page with links wich call a javascript function. I have some problem with javascript. i am two aspx page.. in my first aspx page contain the second...
1
by: Mike | last post by:
I have an web page (page1.aspx) that has a method in the code behind that I want to call from another page. Is this possible to do? The method resides in the page1.aspx.cs file, its a public...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.