473,324 Members | 2,456 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,324 software developers and data experts.

How to get XML file from web page

Hi,

I am making my diploma project and I have following problem...

I am programming in Visual studio ASP.NET using C#. I am using Visual Studio
environment, so I am writing only handlers for buttons and other components.

I would like to make that if user will click on button on my web page, he
will have possibility to choose some file from his filesystem on his hard
disk...

And if there is also posibility if I can read that file as an XML document?

Which components or objects shoud I use for these situations? Could you
recommend me some web page with some examples of these?

Thanks very much... Any advice will help me with finishing of my diploma
project...

Peter
Nov 12 '05 #1
1 1475


Newton wrote:
I am programming in Visual studio ASP.NET using C#. I am using Visual Studio
environment, so I am writing only handlers for buttons and other components.

I would like to make that if user will click on button on my web page, he
will have possibility to choose some file from his filesystem on his hard
disk...

And if there is also posibility if I can read that file as an XML document?

Which components or objects shoud I use for these situations? Could you
recommend me some web page with some examples of these?


How about learning HTML and HTTP and that ASP.NET is just a server side
object model that can receive HTTP requests and make HTTP responses
(where then the response body can be a HTML document)?
HTML has the
<input type="file">
element that you can insert inside of a HTML <form> element to allow the
user to upload files.
So in terms of ASP.NET you need to use a HtmlInputFile control in the
namespace System.Web.UI.HtmlControls, that control has a property
PostedFile which is an instance of HttpPostedFile which for instance has
a property InputStream which you could need to load the posted data into
an System.Xml.XmlDocument or an XmlTextReader.
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIHtmlControlsHtmlInputFileClassTopi c.asp>
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIHtmlControlsHtmlInputFileClassPost edFileTopic.asp>
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebHttpPostedFileClassTopic.asp>

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #2

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

Similar topics

20
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
3
by: Mr Gordonz | last post by:
Hi All, I am reposting this because I need some guidance/advice fairly quickly. I currently have the following setup for saving a file on the server: The user runs a VB app on his/her PC. ...
7
by: moondaddy | last post by:
I want to dynamically create a JavaScript file and cache it on the client for re-use. I know how to write javascript to a web page from the code behind, but I don't know how to actually create a...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
10
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.