Click here to Skip to main content
15,889,595 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: drag drop lists Pin
eyeseetee16-Jul-08 4:01
eyeseetee16-Jul-08 4:01 
Questioncustom Template databound control in asp.net 2.0 Pin
Member 392066716-Jul-08 0:44
Member 392066716-Jul-08 0:44 
Generalupdate gridview ----help pls Pin
merinkmathew16-Jul-08 0:22
merinkmathew16-Jul-08 0:22 
GeneralRe: update gridview ----help pls Pin
Herman<T>.Instance16-Jul-08 1:55
Herman<T>.Instance16-Jul-08 1:55 
GeneralRe: update gridview ----help pls Pin
merinkmathew16-Jul-08 4:09
merinkmathew16-Jul-08 4:09 
GeneralRe: update gridview ----help pls Pin
Herman<T>.Instance16-Jul-08 6:05
Herman<T>.Instance16-Jul-08 6:05 
QuestionProblem in accessing Runtime Controls Pin
nagendrathecoder16-Jul-08 0:10
nagendrathecoder16-Jul-08 0:10 
AnswerRe: Problem in accessing Runtime Controls [modified] Pin
Imran Khan Pathan16-Jul-08 0:47
Imran Khan Pathan16-Jul-08 0:47 
nagendrathecoder wrote:
But the problem is i am not able to check or uncheck those checkboxes and also those are not showing in FindControl() method.


Try this sample.This is working.
I take one PlaceHolder and one button control on page.

On Page_Load event,I create two checkboxes
protected void Page_Load(object sender, EventArgs e)
    {
        CreateCheckBox();
        if (!IsPostBack)
        {
        }
    }


Create Checkbox Method
public void CreateCheckBox()
    {
        CheckBox chk;
        for (int i = 0; i < 2; i++)
        {
            chk = new CheckBox();
            chk.ID = "chk_" + i.ToString();
            chk.AutoPostBack = true;
            //chk.CheckedChanged += new EventHandler(chk_CheckedChanged);
            PL.Controls.Add(chk);
        }
    }

Now I check status of checkbox on Button Click event.
protected void btn_Click(object sender, EventArgs e)
    {
        for (int i = 0; i < 2; i++)
        {
            Response.Write(((CheckBox)this.Page.FindControl("chk_" + i.ToString())).Checked);
        }
    }


Note: You need to create checkboxes on every event of the page so I call that method out of IsPostBack condition.

please don't forget to vote on the post that helped you.

modified on Wednesday, July 16, 2008 6:53 AM

QuestionASP.NET Caching [modified] Pin
10215-Jul-08 23:52
10215-Jul-08 23:52 
AnswerRe: ASP.NET Caching Pin
Sathesh Sakthivel15-Jul-08 23:55
Sathesh Sakthivel15-Jul-08 23:55 
AnswerRe: ASP.NET Caching Pin
eyeseetee16-Jul-08 0:28
eyeseetee16-Jul-08 0:28 
AnswerRe: ASP.NET Caching Pin
sumit703416-Jul-08 0:30
sumit703416-Jul-08 0:30 
Questionpaging doesnt work in update panel Pin
eyeseetee15-Jul-08 23:45
eyeseetee15-Jul-08 23:45 
AnswerRe: paging doesnt work in update panel Pin
Venkatesh Mookkan15-Jul-08 23:48
Venkatesh Mookkan15-Jul-08 23:48 
GeneralRe: paging doesnt work in update panel Pin
eyeseetee16-Jul-08 0:01
eyeseetee16-Jul-08 0:01 
QuestionGridView Pin
Assaf8215-Jul-08 23:36
Assaf8215-Jul-08 23:36 
AnswerRe: GridView Pin
Venkatesh Mookkan15-Jul-08 23:50
Venkatesh Mookkan15-Jul-08 23:50 
GeneralRe: GridView Pin
Assaf8215-Jul-08 23:53
Assaf8215-Jul-08 23:53 
GeneralRe: GridView Pin
Assaf8216-Jul-08 0:00
Assaf8216-Jul-08 0:00 
AnswerRe: GridView Pin
sumit703415-Jul-08 23:52
sumit703415-Jul-08 23:52 
Questionmultiple datatble datas in different different excel files Pin
Member 387988115-Jul-08 22:58
Member 387988115-Jul-08 22:58 
AnswerRe: multiple datatble datas in different different excel files Pin
Sherin Iranimose15-Jul-08 23:28
Sherin Iranimose15-Jul-08 23:28 
GeneralRe: multiple datatble datas in different different excel files Pin
Member 387988115-Jul-08 23:40
Member 387988115-Jul-08 23:40 
GeneralRe: multiple datatble datas in different different excel files Pin
Sherin Iranimose16-Jul-08 0:07
Sherin Iranimose16-Jul-08 0:07 
GeneralRe: multiple datatble datas in different different excel files Pin
Member 387988116-Jul-08 0:12
Member 387988116-Jul-08 0:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.