473,563 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing XML as parameter to Web page

I must be missing something, because this should be easy to do.

After the user has selected several options on a page, I do a database query
which returns a few records that I want to pass to another page via XML. How
do I do this?

I typically Response.Redire ct around my app, including various parameters.
Do I just include the XML as a parameter as in:
Response.Redire ct("page.aspx? " & ds.WriteXML)

That just doesn't seem right.

If you would be so kind as to include both what the sending and receiving
should be doing in any example it would be greatly appreciated!
Nov 19 '05 #1
3 2571
So you have a page, "Page1" which captures some criteria, and then performs
a database query, and passes those results to "Page2" for display.

If it's a particularly small amount of XML, I suppose you could use the
query string, though you want to encode your querystring;

Response.Redire ct("page.aspx? " & Server.UrlEncod e (ds.WriteXML))

But that seems like a particularly risky way to use a querystring.

It makes more sense to me collect your criteria in Page1, then pass the
actual query parameters to Page2, and have Page2 do the query itself. In
most cases the query params will take much less space to transmit than the
query results. Also it makes Page2 more generally usable [barring special
security concerns].

Another option is to do the query, cache either the query or the result in
the database, and then pass the queryID to Page2. That's a useful approach
for very large complex queries, especially if you want to keep a history of
queries a user has run. I use that for real-estate sites, where the user
can have hundreds of criteria, and the broker needs to know what the
customer is searching for.

/// M
"Steven J. Reed" <St*********@di scussions.micro soft.com> wrote in message
news:61******** *************** ***********@mic rosoft.com...
I must be missing something, because this should be easy to do.

After the user has selected several options on a page, I do a database query which returns a few records that I want to pass to another page via XML. How do I do this?

I typically Response.Redire ct around my app, including various parameters. Do I just include the XML as a parameter as in:
Response.Redire ct("page.aspx? " & ds.WriteXML)

That just doesn't seem right.

If you would be so kind as to include both what the sending and receiving
should be doing in any example it would be greatly appreciated!

Nov 19 '05 #2
Can you use “Session”? You can store XML as DOM object or string in Session,
and pass Session state to next page, or next of next page. Session is a
popular way to carry data to next page in ASP.NET.

Shaw
"MWells" wrote:
So you have a page, "Page1" which captures some criteria, and then performs
a database query, and passes those results to "Page2" for display.

If it's a particularly small amount of XML, I suppose you could use the
query string, though you want to encode your querystring;

Response.Redire ct("page.aspx? " & Server.UrlEncod e (ds.WriteXML))

But that seems like a particularly risky way to use a querystring.

It makes more sense to me collect your criteria in Page1, then pass the
actual query parameters to Page2, and have Page2 do the query itself. In
most cases the query params will take much less space to transmit than the
query results. Also it makes Page2 more generally usable [barring special
security concerns].

Another option is to do the query, cache either the query or the result in
the database, and then pass the queryID to Page2. That's a useful approach
for very large complex queries, especially if you want to keep a history of
queries a user has run. I use that for real-estate sites, where the user
can have hundreds of criteria, and the broker needs to know what the
customer is searching for.

/// M
"Steven J. Reed" <St*********@di scussions.micro soft.com> wrote in message
news:61******** *************** ***********@mic rosoft.com...
I must be missing something, because this should be easy to do.

After the user has selected several options on a page, I do a database

query
which returns a few records that I want to pass to another page via XML.

How
do I do this?

I typically Response.Redire ct around my app, including various

parameters.
Do I just include the XML as a parameter as in:
Response.Redire ct("page.aspx? " & ds.WriteXML)

That just doesn't seem right.

If you would be so kind as to include both what the sending and receiving
should be doing in any example it would be greatly appreciated!


Nov 19 '05 #3
Thank you both for your responses. I guess you confirmed my suspicions: you
can't pass a stream as the parameter. I will have to pass the text.

I didn't say it in my original post, but there are a couple of reasons I
can't just do the query in Page2. 1) The database query must be kept
independent from the processing due to manipulation of the data and the fact
the data may be coming from multiple sources. 2) Page2 may be on a
different server. 3) Page2 is actually a few different pages, so the desire
is that the query done in Page1 passes common data to subsequent pages.

....Steve

"Shaw" wrote:
Can you use “Session”? You can store XML as DOM object or string in Session,
and pass Session state to next page, or next of next page. Session is a
popular way to carry data to next page in ASP.NET.

Shaw
"MWells" wrote:
So you have a page, "Page1" which captures some criteria, and then performs
a database query, and passes those results to "Page2" for display.

If it's a particularly small amount of XML, I suppose you could use the
query string, though you want to encode your querystring;

Response.Redire ct("page.aspx? " & Server.UrlEncod e (ds.WriteXML))

But that seems like a particularly risky way to use a querystring.

It makes more sense to me collect your criteria in Page1, then pass the
actual query parameters to Page2, and have Page2 do the query itself. In
most cases the query params will take much less space to transmit than the
query results. Also it makes Page2 more generally usable [barring special
security concerns].

Another option is to do the query, cache either the query or the result in
the database, and then pass the queryID to Page2. That's a useful approach
for very large complex queries, especially if you want to keep a history of
queries a user has run. I use that for real-estate sites, where the user
can have hundreds of criteria, and the broker needs to know what the
customer is searching for.

/// M
"Steven J. Reed" <St*********@di scussions.micro soft.com> wrote in message
news:61******** *************** ***********@mic rosoft.com...
I must be missing something, because this should be easy to do.

After the user has selected several options on a page, I do a database

query
which returns a few records that I want to pass to another page via XML.

How
do I do this?

I typically Response.Redire ct around my app, including various

parameters.
Do I just include the XML as a parameter as in:
Response.Redire ct("page.aspx? " & ds.WriteXML)

That just doesn't seem right.

If you would be so kind as to include both what the sending and receiving
should be doing in any example it would be greatly appreciated!


Nov 19 '05 #4

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

Similar topics

29
4973
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the window properly but does not pass the parameter. (this is part of a coldfusion template) <a href="##"
0
1670
by: stevag | last post by:
I have stored a variable ABC in a ASP.NET page and I use xsltArglist.AddParam in order to add this variable as a parameter to the binded XSLT transformation. In the associated .xslt file I use <xsl:param name="ABC"/> After declaring the parameter , I use it with <xsl:value-of select="$ABC"/> but in the resulting rendered page the value of...
4
2749
by: Ranginald | last post by:
Hi, I'm having trouble passing a parameter from my default.aspx page to my default2.aspx page. I have values from a query in a list box and the goal is to pass the "catID" from default.aspx to a stored procedure on the details2.aspx page. I can successfully pass the values from the listbox control to a
10
12996
by: Janus | last post by:
Hi, Is there a way to pass arguments to the callback function used inside an addEventListener? I see that I can only list the name of the callback function. For eg, I use this: var boldLink=document.getElementById('cmtbold');
1
2244
by: tarunkhatri | last post by:
Hi, I want to pass the parameter of employee_id to a page. My code is working fine and passing parameter to page but the problem is rather then the current parameter. It passed the parameter which was selected in previous submit. Below is the code. <form action='manager_employee_select.php?proc_employee_id=<?php echo $_POST; ?>'...
0
7580
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...
0
7882
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. ...
1
7634
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7945
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...
0
6244
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3634
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2079
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1194
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.