XML in an .ahsx file

Discussion in 'ASP .Net' started by Lloyd Dupont, Dec 6, 2005.

  1. Lloyd Dupont

    Lloyd Dupont Guest

    I'm using a newsgroup/blog/mailing list/forums all in one provider.
    After some negociation they would let me display the web interface of my
    newsgroup with a special template.

    This special tempalet could be provided as a dynamic XML file.

    I'm thinking of using a ".ashx" to generate it, is it a good choice?
    Anyway .ashx begine with a 'context.Response.ContentType = "my xml mime
    type"'
    so.. whatis the XML mimetype?
    I'm thinking of using "text/xml" what do you think of that?
    Lloyd Dupont, Dec 6, 2005
    #1
    1. Advertising

  2. I think using an ASHX file works well:

    context.Response.ClearContent();

    context.Response.ContentType = "application/rss+xml";

    XmlTextWriter xmlTextWriter = new
    XmlTextWriter(context.Response.OutputStream, System.Text.Encoding.UTF8);

    xmlTextWriter.Formatting = Formatting.Indented;

    xmlTextWriter.WriteStartDocument();

    xmlTextWriter.WriteComment("Generated with my xml / rss writer v1.0b");

    xmlTextWriter.WriteStartElement("rss");

    xmlTextWriter.WriteAttributeString("version", "2.0");

    {

    xmlTextWriter.WriteStartElement("channel");

    {

    xmlTextWriter.WriteStartElement("title");


    --

    Andrew Robinson
    www.binaryocean.com
    www.bellinghamdotnet.org


    "Lloyd Dupont" <net.galador@ld> wrote in message
    news:ORrglFr%...
    > I'm using a newsgroup/blog/mailing list/forums all in one provider.
    > After some negociation they would let me display the web interface of my
    > newsgroup with a special template.
    >
    > This special tempalet could be provided as a dynamic XML file.
    >
    > I'm thinking of using a ".ashx" to generate it, is it a good choice?
    > Anyway .ashx begine with a 'context.Response.ContentType = "my xml mime
    > type"'
    > so.. whatis the XML mimetype?
    > I'm thinking of using "text/xml" what do you think of that?
    >
    Andrew Robinson, Dec 6, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leona
    Replies:
    9
    Views:
    1,980
    Henry S. Thompson
    Nov 1, 2004
  2. Robert S

    UPnP xml file to WSDL xml file

    Robert S, Oct 14, 2005, in forum: XML
    Replies:
    1
    Views:
    929
    Robert S
    Oct 14, 2005
  3. jkflens
    Replies:
    2
    Views:
    1,459
    jkflens
    May 30, 2006
  4. Johan
    Replies:
    20
    Views:
    1,597
    Arndt Jonasson
    Feb 27, 2007
  5. Erik Wasser
    Replies:
    5
    Views:
    445
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page