Dynamic generation of web pages in asp.net 2.0
-
How to dynamically generate controls and values of entire web page and every thing (all control types like button or text box .. and their values) comes from databasein asp.net 2.0.
The following code may b helps you This is just an idea you can change into this as your needs.. protected override void Render(HtmlTextWriter writer) { for (int i = 0; i < datatable.rows.count; i++) { Image img = new Image(); img.ImageUrl = string.Format("image1.gif"); img.AlternateText = "My Image"; writer.AddStyleAttribute(HtmlTextWriterStyle.TextAlign, "center"); writer.RenderBeginTag(HtmlTextWriterTag.Div); img.RenderControl(writer); writer.WriteBreak(); writer.Write(todayWeather.ToString()); writer.RenderEndTag(); } }
Deepak :) Smile a Lots,Its Costs Nothing