.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to add html control programmatically

Posted By: Radhika     Posted Date: February 21, 2013    Points:5   Category :ASP.Net
How to add html control textbox programmatically in our asp.net form using C#.

Please help me.

Responses
Author: Faizal             
Posted Date: February 22, 2013     Points: 20   

Hi,

To add HTML control in your web form 1st txke PlaceHolder control from your asp.net web form.

After adding place holder you can write below code in any event

HtmlInputText textBox = new HtmlInputText();
textBox.Value = "SomeValue";
textBox.ID = "MyTextBox";
PlaceHolder1.Controls.Add(textBox);


Note: above code is for HTML TextBox. similarly you can add any html control by its class available in .NET Framework



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend