473,511 Members | 13,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Post Xml to Axd

Here is my scenario. I want to post XML to an AXD page (C#). Simple enough, however my test page that posts the XML, does happen to break into my Axd page on the Load function, but I do not have Session state. So, my question is, with my test XML provided, what are the steps I need to use to set this up?

Test XML (this is trivial): <test><name><first>A</first><last>M</last></name></test>

I then post the XML like this...
<HTML>
<body MS_POSITIONING="FlowLayout">
<form id="Form1" action="Find/SearchEpic.axd" method="post">
<textarea name="searchQuery" cols="100" rows="15">
... my text xml goes here ...
</textarea>
<br>
<input type="submit" value="Post This XML">
</form>
</body>
</HTML>

Then I create an axd page...
public class SearchXml : System.Web.UI.Page {

protected override void OnLoad(EventArgs e) {

System.IO.StreamReader s = new System.IO.StreamReader(HttpContext.Current.Request .InputStream);

XmlDocument receiveXml = new XmlDocument();

.... et cetera ...

}

I process the posted XML input, but I do not have access to Session state, so I cannot get access to some values I need. Am I doing something wrong, or is this behavior expected? Also, in order to test this, should I set up a different way to post my xml as opposed to what I listed above? If so, could someone please show me in C#, the steps required to post XML?

Thanks,

Alex
Nov 18 '05 #1
1 2014
Hello Alex,

Hey Alex... I solved your problem and committed this to the CVS servers at
work... :=)

--
Matt Berther
http://www.mattberther.com
Here is my scenario. I want to post XML to an AXD page (C#). Simple
enough, however my test page that posts the XML, does happen to break
into my Axd page on the Load function, but I do not have Session
state. So, my question is, with my test XML provided, what are the
steps I need to use to set this up?

Test XML (this is trivial):
<test><name><first>A</first><last>M</last></name></test>

I then post the XML like this...
<HTML>
<body MS POSITIONING="FlowLayout">
<form id="Form1" action="Find/SearchEpic.axd" method="post">
<textarea name="searchQuery" cols="100" rows="15">
... my text xml goes here ...
</textarea>
<br>
<input type="submit" value="Post This XML">
</form>
</body>
</HTML>
Then I create an axd page...
public class SearchXml : System.Web.UI.Page {
protected override void OnLoad(EventArgs e) {

System.IO.StreamReader s = new
System.IO.StreamReader(HttpContext.Current.Request .InputStream);

XmlDocument receiveXml = new XmlDocument();

.... et cetera ...

}

I process the posted XML input, but I do not have access to Session
state, so I cannot get access to some values I need. Am I doing
something wrong, or is this behavior expected? Also, in order to test
this, should I set up a different way to post my xml as opposed to
what I listed above? If so, could someone please show me in C#, the
steps required to post XML?

Thanks,

Alex

Nov 18 '05 #2

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

Similar topics

15
3105
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
1
4760
by: khawar | last post by:
my application is in asp.net using C# hi guys having a complicated problem i am using payflowlink to process CC payments I have to send a httppost to their servers. The problem is how do i do a...
2
12535
by: Matt | last post by:
When we submit the form data to another page, we usually do the following: <form action="display.aspx" method="post"> will submit the form data and open display.asp in the current browser ...
1
2959
by: Manuel | last post by:
I have to log into a website and retrieve some information. The problem is that the post isn't "normal". I'm used to passing post values in the form of: Variable1=Value1&Variable2=Value2 etc. I...
10
3390
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
24
2859
by: moriman | last post by:
Hi, The script below *used* to work. I have only just set up a server, PHP etc again on my Win98 system and now it doesn't? On first loading this page, you would have $p = and the button...
9
3076
by: c676228 | last post by:
Hi, I am new to this discussion forum. I started to post questions on this forum since this Jan. and got many good responses and I am very appreciated to those who are willing to help with their...
3
4892
by: JansenH | last post by:
We have implemented a 'HTTP Post' client in C# that posts Xml documents to a webserver. This is working fine if the post rate is one post for every 20 seconds. But if the post rate is increased to...
10
15635
by: Peter Michaux | last post by:
Hi, All Ajax libraries I've read use encodeURIComponent() on the name- value pairs extracted from forms before POST ing the result to the server with and xmlhttprequest. I can understand why...
0
7251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7148
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...
1
7089
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...
0
7517
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...
0
5673
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,...
1
5072
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...
0
4743
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...
0
1581
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 ...
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.