CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Location
    Los Angeles
    Posts
    11

    Open an XML file in ASP.NET

    Seems to be a silly problem but I cannot get it to work. I created an aspx page which is as follows

    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.ContentType = "text/xml";
    }

    protected override void Render(HtmlTextWriter output)
    {
    // output.Write("<A>Abc</A>");

    }

    Up until yesterday this was working fine. Now when I try to open this page, it shows a dialog box asking me to either open or save the file. If I remove the Response.ContentType line then it shows the text "Abc" on the page, but I want to see the content as XML.

    Please help.
    ASN

  2. #2
    Join Date
    Jan 2004
    Location
    Los Angeles
    Posts
    11
    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.ContentType = "text/xml";
    }

    protected override void Render(HtmlTextWriter output)
    {
    output.Write("<A>Abc</A>");
    }

    The output line is not commented as in the first post.
    ASN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured