include HTML code from html page

Discussion in 'ASP .Net' started by Kevin, Sep 27, 2005.

  1. Kevin

    Kevin Guest

    How do I include mb.html if I check file is existed? I'm assuming I do this in codebehind, but how?

    Basically if the file exists, it should display the page that will include mb.html.





    ---------------------------------------------------------------------------------------------------------

    html code inside mb.html

    <table><tr><td>9/27/2005 11:00:43 AM</td><td>God is great!</td></tr></table>
    <table><tr><td>9/27/2005 11:01:03 AM</td><td>I love Jesus</td></tr></table>



    In my codebehind,

    if (File.Exists(Server.MapPath(mb.html)))

    {

    // include mb.html html code



    }

    else

    {

    do something else

    }
    Kevin, Sep 27, 2005
    #1
    1. Advertising

  2. Kevin

    Siva M Guest

    I don't think it is possible in that way. Rather, read the content of the file if it exists and assign it to a Label control's Text property. Place the Label control where you the mb.html's content should appear on the page.
    "Kevin" <> wrote in message news:...
    How do I include mb.html if I check file is existed? I'm assuming I do this in codebehind, but how?

    Basically if the file exists, it should display the page that will include mb.html.





    ---------------------------------------------------------------------------------------------------------

    html code inside mb.html

    <table><tr><td>9/27/2005 11:00:43 AM</td><td>God is great!</td></tr></table>
    <table><tr><td>9/27/2005 11:01:03 AM</td><td>I love Jesus</td></tr></table>



    In my codebehind,

    if (File.Exists(Server.MapPath(mb.html)))

    {

    // include mb.html html code



    }

    else

    {

    do something else

    }
    Siva M, Sep 27, 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. =?Utf-8?B?RGF2aWQgSm9uZXM=?=

    Include file for code behind vb page for .aspx page

    =?Utf-8?B?RGF2aWQgSm9uZXM=?=, May 23, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    5,432
    =?Utf-8?B?RGF2aWQgSm9uZXM=?=
    May 27, 2005
  2. Danny Anderson
    Replies:
    5
    Views:
    479
    Victor Bazarov
    Aug 15, 2003
  3. ms_sarwar
    Replies:
    1
    Views:
    591
    ms_sarwar
    Sep 7, 2007
  4. ms_sarwar
    Replies:
    0
    Views:
    804
    ms_sarwar
    Sep 10, 2007
  5. Andreas Bogenberger
    Replies:
    3
    Views:
    875
    Andreas Bogenberger
    Feb 22, 2008
Loading...

Share This Page