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. Include HTML into ASPX and buttons

Include HTML into ASPX and buttons

Scheduled Pinned Locked Moved ASP.NET
htmldatabasehelptutorialquestion
9 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
    caheo
    wrote on last edited by
    #1

    Hi everyone I'm an situation that I don't know how to solve. First, I have several files which will be generated from database and saved under html format and store in a different folder (this was created by so else which does not include buttons for me). Because I need to include those files into my application. I have used this: Response.Redirect("filename.html") to output the entire html file into my aspx page. Unfortunately, I want to still have to maintain my page to keep going further to next instructions. I want to have 2 buttons below those files. I don't know how to do that. I thought if using placeholder can solve the problem and how? Thanks.

    G 1 Reply Last reply
    0
    • C caheo

      Hi everyone I'm an situation that I don't know how to solve. First, I have several files which will be generated from database and saved under html format and store in a different folder (this was created by so else which does not include buttons for me). Because I need to include those files into my application. I have used this: Response.Redirect("filename.html") to output the entire html file into my aspx page. Unfortunately, I want to still have to maintain my page to keep going further to next instructions. I want to have 2 buttons below those files. I don't know how to do that. I thought if using placeholder can solve the problem and how? Thanks.

      G Offline
      G Offline
      Guillermo Rivero
      wrote on last edited by
      #2

      You can open the file, read the contents into a stream and write the stream into your ASPX page using Response.Write I used it and it worked good... Free your mind...

      C 1 Reply Last reply
      0
      • G Guillermo Rivero

        You can open the file, read the contents into a stream and write the stream into your ASPX page using Response.Write I used it and it worked good... Free your mind...

        C Offline
        C Offline
        caheo
        wrote on last edited by
        #3

        Can you please be more specific?

        G 1 Reply Last reply
        0
        • C caheo

          Can you please be more specific?

          G Offline
          G Offline
          Guillermo Rivero
          wrote on last edited by
          #4

          I guess your problem is you want to send the contents of a page and then write some controls, isn't it ?? Once I had the same problem and found a solution with this.

          string templateFileName = Path.Combine( Server.MapPath("."), "ThePage.html");
          StreamReader reader = new StreamReader(@templateFileName);
          string html = reader.ReadToEnd();
          reader.Close();

          		Response.Write(html);
          		Response.Flush();
          

          Got the idea ?? Free your mind...

          C 1 Reply Last reply
          0
          • G Guillermo Rivero

            I guess your problem is you want to send the contents of a page and then write some controls, isn't it ?? Once I had the same problem and found a solution with this.

            string templateFileName = Path.Combine( Server.MapPath("."), "ThePage.html");
            StreamReader reader = new StreamReader(@templateFileName);
            string html = reader.ReadToEnd();
            reader.Close();

            		Response.Write(html);
            		Response.Flush();
            

            Got the idea ?? Free your mind...

            C Offline
            C Offline
            caheo
            wrote on last edited by
            #5

            Yeah that's what I'm looking for. It's very neat. Thanks a lot. However, I still want to add some web controls to the page, would you please point it out for me as well?

            G 1 Reply Last reply
            0
            • C caheo

              Yeah that's what I'm looking for. It's very neat. Thanks a lot. However, I still want to add some web controls to the page, would you please point it out for me as well?

              G Offline
              G Offline
              Guillermo Rivero
              wrote on last edited by
              #6

              Add your controls after you write the page... Search here on CP about adding controls to a page dynamically... Free your mind...

              C 2 Replies Last reply
              0
              • G Guillermo Rivero

                Add your controls after you write the page... Search here on CP about adding controls to a page dynamically... Free your mind...

                C Offline
                C Offline
                caheo
                wrote on last edited by
                #7

                Thanks a lot

                1 Reply Last reply
                0
                • G Guillermo Rivero

                  Add your controls after you write the page... Search here on CP about adding controls to a page dynamically... Free your mind...

                  C Offline
                  C Offline
                  caheo
                  wrote on last edited by
                  #8

                  I have another question. All contents of my HTML have diffent size. How do I know where I can insert my buttons?

                  G 1 Reply Last reply
                  0
                  • C caheo

                    I have another question. All contents of my HTML have diffent size. How do I know where I can insert my buttons?

                    G Offline
                    G Offline
                    Guillermo Rivero
                    wrote on last edited by
                    #9

                    Write your controls after you write the contents of the page. The control I added after the page was written, was a button that had an onclich event to close the form, so it was easy. Free your mind...

                    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