Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Conditional Statements for Repeaters?

Reply
Thread Tools

Conditional Statements for Repeaters?

 
 
Brad Baker
Guest
Posts: n/a
 
      04-18-2006
I have several asp.net repeaters which I need to display based on the value
of a dropdown. I.E. If item1 in a dropdown is selected then repeater1 needs
to be displayed, if item item2 is selected then repeater2 needs to be
displayed.



I have no problem writing and displaying a single repeater and I know how to
test the value of a dropdown but I can't seem to figure out how to combine
the two. (In other words test for the value of form variable, then display
the corresponding repeater in the body of a page.)



Is there a way to do what I want in C# or am I approaching this problem from
the wrong angle?



Thanks,

Brad


 
Reply With Quote
 
 
 
 
OHM \( One Handed Man \)
Guest
Posts: n/a
 
      04-18-2006
repeater1.visible = false

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Brad Baker" <(E-Mail Removed)> wrote in message
news:O%(E-Mail Removed)...
>I have several asp.net repeaters which I need to display based on the value
>of a dropdown. I.E. If item1 in a dropdown is selected then repeater1 needs
>to be displayed, if item item2 is selected then repeater2 needs to be
>displayed.
>
>
>
> I have no problem writing and displaying a single repeater and I know how
> to test the value of a dropdown but I can't seem to figure out how to
> combine the two. (In other words test for the value of form variable,
> then display the corresponding repeater in the body of a page.)
>
>
>
> Is there a way to do what I want in C# or am I approaching this problem
> from the wrong angle?
>
>
>
> Thanks,
>
> Brad
>
>



 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      04-18-2006
Hi Brad,

I think you can consider Terry's suggestion that add those repeater
statically on the page but make them invisible. Then, in the DropDownlist's
SelectedIndexChanged event, dynamically use the Repeater.visible property
to make certain repeater displayed according to the new selected item's
value.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.


 
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
if statements and case statements questions John Crichton Ruby 6 07-12-2010 06:17 PM
Prepare Statements VS Statements Vince Java 12 01-21-2008 01:18 PM
component statements within architecture statements Neil Zanella VHDL 8 10-20-2006 09:05 AM
if statements with or w/o else statements Harry George Python 6 02-23-2004 06:48 PM
Conditional Bean:Define Statements In Struts Cowboy Bob Java 1 01-29-2004 12:14 AM



Advertisments