Monday, December 29, 2008

ASP.Net and C# Create HTML Controls Dynamically

ASP.Net & C# Create HTML Controls

Dynamically

It is very easy to create HTML controls before running a Web Page. Just Drag and Drop from ToolBox or write HTML code or ASP code for that Web Page (.aspx). But people think that generating HTML controls during runtime is difficult. But it’s quite easy.

There are many methods of generating controls during runtime.

Here is the one.

First thing is that you need to add a Panel by drag and drop it from the toolbox.

After that you need to write the C# code in Page Load event or button event as follows :

That’s it. Its all Done. Its So Simple isn’t it!

No comments: