<%@ Page Language="C#" %> <html> <head id="Head2" runat="server"> <script runat="server"> protected override void OnInit(EventArgs e) { base.OnInit(e); /// /// Method 1: /// string htmlInput = "<input type=\"text\" id=\"inputId\" name=\"inputName\" value=\"Hello World\" />"; this.phHtmlControl.Controls.Add(new Literal() { Text = htmlInput }); /// /// Method 2: /// this.phHtmlControl.Controls.Add( ParseControl("<asp:CheckBox ID=\"chkDisabled\" Text=\"Disabled\" runat=\"server\" />")); } protected void Save(object sender, EventArgs e) { /// /// Method 1 /// string htmlInputValue = this.Request.Form.Get("inputName"); /// /// Method 2 /// CheckBox chkDisabled = (CheckBox)FindControl("chkDisabled"); if (chkDisabled != null) bool disabled = chkDisabled.Checked; } </script> </head> <body> <form id="form2" runat="server"> <asp:PlaceHolder runat="server" ID="phHtmlControl" /> <asp:Button runat="server" ID="btnSave" Text="Save" OnClick="Save" /> </form> </body> </html
Saturday, October 02, 2010
How to write some html to asp.net page output stream
Subscribe to:
Post Comments (Atom)
Azure Storage Account Types
Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...
-
Why we need asynchronous tasks? Execute a time consuming operations in parallel to the CLR thread which execute the request If you have ...
-
Demo: I was thinking a way to show images before actually uploading them to server. I would say to preview images using javascript. Obv...
1 comment:
Thank you for sharing with useful, good tips. Currently mobile technologies are the most used in android phone development that needs in developing of mobile software applets for cells.
Post a Comment