By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,671 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,671 IT Pros & Developers. It's quick & easy.

Post Xml to Axd

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.