0

hi guys i am using this code in my aspx page

<%for (int i=o;i<5;i++)
{%>
  <asp: link button id=i text=i/>

<%}%>

at it producing five link buttons like
i i i i i

but i just want five link buttons like that

1 2 3 4 5
with id=1,2,3,4,5 respectively

how can I can implement that

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by dnanetwork
0

put this in google...creating controls at run time + asp.net 2.0

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class Default2 : System.Web.UI.Page
{
Label lb1;
TextBox txt;
Button btn1;
protected void Button1_Click(object sender, EventArgs e)
{
lb1=new Label();
txt = new TextBox();
txt.ID = “txt1″;
btn1 = new Button();
btn1.ID = “bt1″;
btn1.Text = “Click”;
Panel1.Controls.Add(txt);
Panel1.Controls.Add(btn1);
Panel1.Controls.Add(lb1);

lb1.Text = “Dynamic”;

hope it helps...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.