Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ASP.NET Beginner Question

ASP.NET Beginner Question

Scheduled Pinned Locked Moved ASP.NET
questioncsharpc++htmlasp-net
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Richardson
    wrote on last edited by
    #1

    Hi all, I'm from an C++ and MFC background, and I'm just kind of messing around with ASP.NET using C#. I have lots of questions so far, but one in particular that I need to figure out before I get much further. What is the correct way to generate an HTML page? I've tried using Response.Write from Page_Load, but this puts my table before the starting tag. So I tried searching, and I found something saying that overriding Render was the correct way to do it. However, this leaves me with no tags at all. And I'm also interested in having a form created at design time, so I can't just output the complete HTML page ( tags and all) from Render. Can anybody help me please? All the examples I see on the web show how to do this using classic ASP style, where the code is mixed in the page, and I am loathe to do that. Thanks in Advance, Chris Richardson

    N 1 Reply Last reply
    0
    • C Chris Richardson

      Hi all, I'm from an C++ and MFC background, and I'm just kind of messing around with ASP.NET using C#. I have lots of questions so far, but one in particular that I need to figure out before I get much further. What is the correct way to generate an HTML page? I've tried using Response.Write from Page_Load, but this puts my table before the starting tag. So I tried searching, and I found something saying that overriding Render was the correct way to do it. However, this leaves me with no tags at all. And I'm also interested in having a form created at design time, so I can't just output the complete HTML page ( tags and all) from Render. Can anybody help me please? All the examples I see on the web show how to do this using classic ASP style, where the code is mixed in the page, and I am loathe to do that. Thanks in Advance, Chris Richardson

      N Offline
      N Offline
      Nick Seng
      wrote on last edited by
      #2

      How do you mean generate an HTML page? Do you mean to create a page dynamically at runtime? If so, there are 2 ways I would do it: 1. Place a label on the web form at design time. The during runtime, assign the html tags into the label, like so:

      label.Text ="........

      ";

      2. You can use the framework to add the objects into the form.

      TextBox txt = new TextBox();
      txt.Id = "txt1";
      //set other properties
      Page.Controls.Add(txt);

      or something to that effect. Hope that helps


      God, I pity me! - Phoncible P. Bone If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you

      C 1 Reply Last reply
      0
      • N Nick Seng

        How do you mean generate an HTML page? Do you mean to create a page dynamically at runtime? If so, there are 2 ways I would do it: 1. Place a label on the web form at design time. The during runtime, assign the html tags into the label, like so:

        label.Text ="........

        ";

        2. You can use the framework to add the objects into the form.

        TextBox txt = new TextBox();
        txt.Id = "txt1";
        //set other properties
        Page.Controls.Add(txt);

        or something to that effect. Hope that helps


        God, I pity me! - Phoncible P. Bone If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you

        C Offline
        C Offline
        Chris Richardson
        wrote on last edited by
        #3

        Nick Seng wrote: Place a label on the web form at design time. The during runtime, assign the html tags into the label Thanks a lot Nick, this is just what I needed :). As for number 2, what I meant was that I needed to output HTML after an existing form (that I put in at design time), and I was only able to put the HTML before the form, using Response.Write, or if I used the Render override, I could only output the entire HTML page (thus erasing my form). So, anyways, what you told me is exactly perfect, thanks again! :D Chris Richardson

        N 1 Reply Last reply
        0
        • C Chris Richardson

          Nick Seng wrote: Place a label on the web form at design time. The during runtime, assign the html tags into the label Thanks a lot Nick, this is just what I needed :). As for number 2, what I meant was that I needed to output HTML after an existing form (that I put in at design time), and I was only able to put the HTML before the form, using Response.Write, or if I used the Render override, I could only output the entire HTML page (thus erasing my form). So, anyways, what you told me is exactly perfect, thanks again! :D Chris Richardson

          N Offline
          N Offline
          Nick Seng
          wrote on last edited by
          #4

          You're welcome. Good luck with ASP.Net. :-D


          Support Bone

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups