Solved

Write XML to the output stream from an ASP.NET web site

Posted on 2006-06-22
6
744 Views
Last Modified: 2008-02-01
I have an ASP.NET web site using VB.NET and I would like to dump XML to the output stream.  For example,

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    dim dataset1 as New Data.DataSet=getbudgets()
    response.Write(dataset1 as xml)           'this is the part that doesn't work
End Sub





I have to think this can be done since an ASP.NET XML web service consists of functions like

<WebMethod()> _
    Public Function getSystemLog(ByVal FromDate As Date, ByVal ToDate As Date) As SystemLogEntryType()
        Dim retval(1) As SystemLogEntryType

and they spit out XML
0
Comment
Question by:stev0931
  • 3
  • 3
6 Comments
 
LVL 26

Accepted Solution

by:
Rejojohny earned 500 total points
ID: 16965180
response.Write(dataset1.getxml()) should work ..

Rejo
0
 

Author Comment

by:stev0931
ID: 16966021
Great!  By any chance, do you know how to do this for an arbitrary object type?
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 16970561
what is an arbitrary object type??
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:stev0931
ID: 16970876
For example,

class DataType

public ID as long
public Name as string
public Description as string
...

end class
0
 
LVL 26

Assisted Solution

by:Rejojohny
Rejojohny earned 500 total points
ID: 16971205
i do not think there is any generic way of converting a class to xml ..
0
 

Author Comment

by:stev0931
ID: 17024242
Thanks!  I've got a solution working now...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now