Repeater outside Event handling

 Ø Repeater outside Event handling .

FOR LOOP is used for this

 

Ex:-  // connnection open code

        string path = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\college.mdf;Integrated Security=True";

        con = new SqlConnection(path);

        con.Open();

        

        for (int i=0; i<Repeater1.Items.Count;i++ )

        {

            //find label control

            //control objectname = Repeater1.Items[loopvariable].findcontrol("ID") as control

 

            Label lblname1 = Repeater1.Items[i].FindControl("lblname") as Label;

            Response.Write(lblname1.Text);

        }

 

Comments

Popular posts from this blog

ViewState for state management

Store procedure Data Base handling (procedure_insert).

Database joining