473,396 Members | 1,924 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,396 software developers and data experts.

Post xml to Asp.net page

My windows application (console application) posts xml (HTTP "POST") to
Asp.net page. My question is:

1. How should I code my Asp.net page so that it is able to 'detect' that
something is posted to it ?

2. How do I extract the xml from the html page ?

Thanks.
Nov 19 '05 #1
3 3505
Hi,

I'm answering your both queries here:
For the first question:, you can use the Request.Form to detect whatever has been posted

to the ASP.NET page as follows:

Request.Form("fieldname")

Now for the second question, since Xml is being posted to the page, Do a request.form() of the fieldname
that contains the XML, store it into a string. Then use XMLDOcument to save it to an XML file or use XMLWRiter

HTH

Mona[Grapecity]
"quest" <an********@microsoft.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
My windows application (console application) posts xml (HTTP "POST") to
Asp.net page. My question is:

1. How should I code my Asp.net page so that it is able to 'detect' that
something is posted to it ?

2. How do I extract the xml from the html page ?

Thanks.

Nov 19 '05 #2
depends on how the console app is posting. if its a form post, then use
Request["fieldName"], if the body is just xml, use Request.InputStream, if
its a soap call, use the web service interface. it could also be a file
upload, or attachment. you will also need to know of any encofding schemes
used.

-- bruce (sqlwork.com)

"quest" <an********@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
My windows application (console application) posts xml (HTTP "POST") to
Asp.net page. My question is:

1. How should I code my Asp.net page so that it is able to 'detect' that
something is posted to it ?

2. How do I extract the xml from the html page ?

Thanks.

Nov 19 '05 #3
Thanks for the information. I created a simple Asp.net application. Request.Form will work but exactly when I should do "Request.Form" ? Is there any event driven stuffs to deal with when a POST is detected ? Thanks in advance.

using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace MyWeb
{
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
"Mona" <mo**@discussions.microsoft.com> wrote in message news:OC**************@tk2msftngp13.phx.gbl...
Hi,

I'm answering your both queries here:
For the first question:, you can use the Request.Form to detect whatever has been posted

to the ASP.NET page as follows:

Request.Form("fieldname")

Now for the second question, since Xml is being posted to the page, Do a request.form() of the fieldname
that contains the XML, store it into a string. Then use XMLDOcument to save it to an XML file or use XMLWRiter

HTH

Mona[Grapecity]
"quest" <an********@microsoft.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
My windows application (console application) posts xml (HTTP "POST") to
Asp.net page. My question is:

1. How should I code my Asp.net page so that it is able to 'detect' that
something is posted to it ?

2. How do I extract the xml from the html page ?

Thanks.

Nov 19 '05 #4

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

Similar topics

3
by: Bernd Kohler | last post by:
Hello, I got an annoying problem using the POST-method to send a form's data: I put a login-form on the page which is sent by the POST-method to itself. After that the content of the...
1
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
4
by: James Johnson | last post by:
Dear C#Dex, I am trying to automate a POST to a web page that clicks a button. I have been able to hit a target web page and run the web page. However, the button on the page does not click. ...
2
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 ...
9
by: Alan Silver | last post by:
Hello, From my limited experience with ASP.NET (couple of weeks so far, much time wasted with stupid book), you can only have one form per page. If so, how do you handle the scenario where you...
10
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...
1
by: David | last post by:
I need to redirect to a page and HTTP Post data. The Response.Redirect does not work and the HTTPREQUEST option calls the page and waits for a response, but I need to transfer control to the...
0
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use...
56
by: UKuser | last post by:
Hi, I'm not sure if this can be done as I've searched the web and this forum. I am using an online merchant provider and I must post certain variables to their webforms through a form on my...
3
by: Jag | last post by:
Hi I am facing a strange issue. I have 3 ASP pages in the default website 1. auth.aspx <html> <body>
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
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...

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.