www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
This page is specific to
.NET Framework 3.0

Other versions are also available for the following:
  • Microsoft Visual Studio 2005/.NET Framework 2.0
  • Microsoft Visual Studio 2008/.NET Framework 3.5
  • .NET Framework Developer's Guide 
    ASP.NET Web Applications (.NET 3.0) 

    ASP.NET is a unified Web platform that provides all the services necessary for you to build enterprise-class applications. ASP.NET is built on the .NET Framework, so all .NET Framework features are available to ASP.NET applications. Your applications can be written in any language compatible with the common language runtime, including Visual Basic, C#, and JScript. The topics in this section provide details about how to use the features offered by ASP.NET.

    In This Section

    Related Sections

    Community Content
     
    Add Community Content
    Transform XML From A Remote Server      Orpheus ... tottosimon   |   Edit   |  

    Using a <asp:Xml control:

    <asp:Xml id="Xml1" runat="server" TransformSource="Weather.xsl"></asp:Xml>

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Try
    Dim HttpSite As Uri = New Uri("http://www.weather.gov/data/current_obs/KIPT.xml")
    Dim wreq As HttpWebRequest = CType(WebRequest.Create(HttpSite), HttpWebRequest)
    wreq.KeepAlive = False
    wreq.Timeout = 30000
    'Get the data as an HttpWebResponse object
    Dim resp As HttpWebResponse = wreq.GetResponse()
    Dim strReader As StreamReader = New StreamReader(resp.GetResponseStream(), System.Text.Encoding.UTF8)
    Dim tr As New XmlTextReader(strReader)
    Dim doc As New XmlDocument
    doc.Load(tr)
    Xml1.Document = doc
    resp.Close()
    wreq.Abort()
    Catch ex As Exception
    Xml1.DocumentSource = "Weather.xml"
    End Try
    End Sub
    Tags What's this?: <asp:xml (x) > (x) id= (x) xml1 (x) Add a tag
    See Also info      Clayton Rogers - MSFT ... tottosimon   |   Edit   |  
    Tags What's this?: Add a tag
    © 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
    Page view tracker
    DCSIMG