Include HTML into ASPX and buttons
-
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.
-
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.
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...
-
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...
-
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...
-
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...
-
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?
Add your controls after you write the page... Search here on CP about adding controls to a page dynamically... Free your mind...
-
Add your controls after you write the page... Search here on CP about adding controls to a page dynamically... Free your mind...
-
Add your controls after you write the page... Search here on CP about adding controls to a page dynamically... Free your mind...
-
I have another question. All contents of my HTML have diffent size. How do I know where I can insert my buttons?
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...