473,785 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6005


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(s Url)
or you can use an XPathDocument e.g.
XPathDocument xPathDocument = new XPathDocument(s Url);
or you can create an XmlDocument instance and use the Load method
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Loa d(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
2609
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 button in main.aspx. When the user clicks the button, it should call mycalendar.aspx and pop up a calendar control. The problem is I don't know how to call a function in another aspx page? Or I shouldn't do in this approach?
7
1519
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 categories change from time to time so the list of categories must be dynamic and database driven (as is the menu used to select the category to load in the products page). The way I see it there's 2 possible options. dynamically create each aspx...
2
3051
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. Furthermore I know there will be a postback involved but the state of the page will not change at all so I would like it to be as efficient as possible with no appearance to the user that anything happened. I saw in someone else's code where...
6
12289
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 would like to do this by defining a NewFunc() that is different in each (code-behind) page which is called by the standard 'New' button in the toolbar. How can I get this to work? So far I have the following (which doesnt work). When the user...
3
1791
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:- lblstrp.Text=lblstr.Text; <asp:label id="lblstrp" BorderColor="#ff3333" BorderStyle="Dashed" BorderWidth="3" ForeColor="#0033cc" Font-Size="25" Runat="server" Width="55%" BackColor="#ffff00"></asp:label>
2
13464
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 to include in multiple aspx pages where they'll be able to upload images for other purposes. On the first page that I'm working on where users will be doing the upload (which I'll call the 'parent' page) I also have a DataGrid where I display...
1
1605
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 page. I am having problems with writing the correct syntax. Is there a reference you could point me to with a good example? Thanks!
3
3596
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 a javascript method. I try it with GetCallbackEventReference but this tech works async. Could I use a javascript function with a sync call ? Thaks for responses,
1
1851
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 aspx page name.. i am clicking the second page link the second page is opened..
1
9233
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 method, is there a way I can call that method from another web page? Page2.aspx.cs needs to call Public Void GetCars() in Page1.aspx.cs - is this possible?
0
9489
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10357
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.