Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - cannot detect the repeater

 
Thread Tools Search this Thread
Old 08-23-2005, 11:47 AM   #1
Default cannot detect the repeater


Hi,

I display a repeater in a web page, when i click on the next button, I want
to loop thru the repeater to detect the checkbox controls. Previously this
code works, but now .... I used the debugger n found that the program cannot
even detect the repeater control coz it just skips past this line. I have
listed a abbrev. version of my code below:

private void btnNext_Click(object sender, System.EventArgs e)
{
tstdAnswer = "";
try
{
foreach(RepeaterItem r in MyRepeater.Items) <----
{ for (int i=1; i<=6; i++) { //6 checkboxes
CheckBox chk = (CheckBox)r.FindControl("chkbox"+ i);
if(chk.Checked == true)
{
tstdAnswer += "1";
}
else
tstdAnswer += "0";
}
}
}
}

TIA.
Andrew.


=?Utf-8?B?QW5kcmV3?=
  Reply With Quote
Old 08-23-2005, 02:09 PM   #2
=?Utf-8?B?U2FjaGluIFNha2k=?=
 
Posts: n/a
Default Re: cannot detect the repeater
Use RepeaterItem r in MyRepeater.Items.Controls(0)

Regards,
Sachin Saki
..NET Developer - Capgemini, INDIA
"Eliyahu Goldin" ने लिखा:

> Andrew,
>
> Probably you mean MyRepeater.Items is empty rather than there is no
> repeater, otherwise you would get an exception.
>
> Anyway, check EnableViewState properties for the page and for the repeater
> and check the data populating logic in Page_Load .
>
> Eliyahu
>
> "Andrew" <> wrote in message
> news:FCDB6DC6-0AE7-4FE6-9856-...
> > Hi,
> >
> > I display a repeater in a web page, when i click on the next button, I

> want
> > to loop thru the repeater to detect the checkbox controls. Previously this
> > code works, but now .... I used the debugger n found that the program

> cannot
> > even detect the repeater control coz it just skips past this line. I have
> > listed a abbrev. version of my code below:
> >
> > private void btnNext_Click(object sender, System.EventArgs e)
> > {
> > tstdAnswer = "";
> > try
> > {
> > foreach(RepeaterItem r in MyRepeater.Items) <----
> > { for (int i=1; i<=6; i++) { //6 checkboxes
> > CheckBox chk = (CheckBox)r.FindControl("chkbox"+ i);
> > if(chk.Checked == true)
> > {
> > tstdAnswer += "1";
> > }
> > else
> > tstdAnswer += "0";
> > }
> > }
> > }
> > }
> >
> > TIA.
> > Andrew.

>
>
>



=?Utf-8?B?U2FjaGluIFNha2k=?=
  Reply With Quote
Old 08-23-2005, 02:23 PM   #3
Eliyahu Goldin
 
Posts: n/a
Default Re: cannot detect the repeater
Andrew,

Probably you mean MyRepeater.Items is empty rather than there is no
repeater, otherwise you would get an exception.

Anyway, check EnableViewState properties for the page and for the repeater
and check the data populating logic in Page_Load .

Eliyahu

"Andrew" <> wrote in message
news:FCDB6DC6-0AE7-4FE6-9856-...
> Hi,
>
> I display a repeater in a web page, when i click on the next button, I

want
> to loop thru the repeater to detect the checkbox controls. Previously this
> code works, but now .... I used the debugger n found that the program

cannot
> even detect the repeater control coz it just skips past this line. I have
> listed a abbrev. version of my code below:
>
> private void btnNext_Click(object sender, System.EventArgs e)
> {
> tstdAnswer = "";
> try
> {
> foreach(RepeaterItem r in MyRepeater.Items) <----
> { for (int i=1; i<=6; i++) { //6 checkboxes
> CheckBox chk = (CheckBox)r.FindControl("chkbox"+ i);
> if(chk.Checked == true)
> {
> tstdAnswer += "1";
> }
> else
> tstdAnswer += "0";
> }
> }
> }
> }
>
> TIA.
> Andrew.





Eliyahu Goldin
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.Net - Data Repeater vbnetman General Help Related Topics 0 01-07-2008 11:34 AM
Aironet 1130 Transparent Bridge & Repeater gman Hardware 3 09-21-2007 03:33 AM
cisco 1200 repeater mode danielb Hardware 1 11-03-2006 01:39 AM
Are there receivers that could correctly detect Dolby Digital EX? chromallly@yahoo.com DVD Video 15 08-01-2005 02:47 PM
need app to detect ntsc or pal free2002 DVD Video 4 03-06-2004 09:41 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46