Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > stuck on this one

Reply
Thread Tools

stuck on this one

 
 
=?Utf-8?B?TWlrZQ==?=
Guest
Posts: n/a
 
      10-06-2004
I'm trying to find a label and the value within a datalist, i've done this in
the passed in the datalist_itemdatbound routine and worked likes a charm. Now
I"m trying to do the samething in a seperate routine and I can't find the
value.
in the routine i'm getting the value of the checkbox, checked or not and
passing that correctly, I also want to the get a the value of the associated
label with the checkbox and i can't get that working.

I have this:
for I = o to datalist.items.count - 1
checked = datalist.items(I).findcontrol("checkbox")
text = datatlist.items(I).findcontrol("labelname")
value = value & checked.checked.tostring() & text.text.tostring()
next

i'm getting the checkbox value but not the text value.

any ideas why this is happening?

 
Reply With Quote
 
 
 
 
Michael Tkachev
Guest
Posts: n/a
 
      10-06-2004
I writing this in the C#. You will be able to convert it to the VB

CheckBox cb = (CheckBox)datalist.items[i].Controls.FindControl("checkbox");
bool cval = cb.Checked;
Label lbl = (Label)datalist.items[i].Controls.FindControl("label");

also you can use code like this:

CheckBox cb = (CheckBox)datalist.items[i].Controls[0];
bool cval = cb.Checked;
Label lbl = (Label)datalist.items[i].Controls[1];

in the C# the first control is 0 and in the VB the first control is 1
if your listItem has two controls you have to try to find control 1 and 2

bye

"Mike" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm trying to find a label and the value within a datalist, i've done this

in
> the passed in the datalist_itemdatbound routine and worked likes a charm.

Now
> I"m trying to do the samething in a seperate routine and I can't find the
> value.
> in the routine i'm getting the value of the checkbox, checked or not and
> passing that correctly, I also want to the get a the value of the

associated
> label with the checkbox and i can't get that working.
>
> I have this:
> for I = o to datalist.items.count - 1
> checked = datalist.items(I).findcontrol("checkbox")
> text = datatlist.items(I).findcontrol("labelname")
> value = value & checked.checked.tostring() & text.text.tostring()
> next
>
> i'm getting the checkbox value but not the text value.
>
> any ideas why this is happening?
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZQ==?=
Guest
Posts: n/a
 
      10-06-2004
thats simialar to what i have and i can't get the label to be recognized:

For I = 0 To datalist.Items.Count - 1
checkbox= dlScores.Items(I).FindControl("chkStuff")
CarInformation= dlScores.Items(G).FindControl("CarStuff")
value = value & checkbox.Checked.ToString() & "|" &
CarInformation.text & "|"
Next I


"Michael Tkachev" wrote:

> I writing this in the C#. You will be able to convert it to the VB
>
> CheckBox cb = (CheckBox)datalist.items[i].Controls.FindControl("checkbox");
> bool cval = cb.Checked;
> Label lbl = (Label)datalist.items[i].Controls.FindControl("label");
>
> also you can use code like this:
>
> CheckBox cb = (CheckBox)datalist.items[i].Controls[0];
> bool cval = cb.Checked;
> Label lbl = (Label)datalist.items[i].Controls[1];
>
> in the C# the first control is 0 and in the VB the first control is 1
> if your listItem has two controls you have to try to find control 1 and 2
>
> bye
>
> "Mike" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I'm trying to find a label and the value within a datalist, i've done this

> in
> > the passed in the datalist_itemdatbound routine and worked likes a charm.

> Now
> > I"m trying to do the samething in a seperate routine and I can't find the
> > value.
> > in the routine i'm getting the value of the checkbox, checked or not and
> > passing that correctly, I also want to the get a the value of the

> associated
> > label with the checkbox and i can't get that working.
> >
> > I have this:
> > for I = o to datalist.items.count - 1
> > checked = datalist.items(I).findcontrol("checkbox")
> > text = datatlist.items(I).findcontrol("labelname")
> > value = value & checked.checked.tostring() & text.text.tostring()
> > next
> >
> > i'm getting the checkbox value but not the text value.
> >
> > any ideas why this is happening?
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Laptop stuck on one regional code Miriam Seshadri DVD Video 10 06-14-2007 05:47 PM
stuck on this one NuB ASP .Net 2 09-13-2005 09:38 PM
One Hot FSM stuck !! Nic VHDL 5 03-02-2004 06:31 PM
CCD vs. CMOS: which one is more reliable: dead/hot/stuck pixels (mediuum-long and many questions) fake name Digital Photography 19 03-01-2004 08:27 PM
Have two ATA100 Seagate drives in a vp6, one IDE channel comes up as mode 5 in winxp but the other channel is stuck in mode 4 Tim Computer Support 3 02-23-2004 03:35 AM



Advertisments