473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Conditional Statements for Repeaters?

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
Apr 18 '06 #1
2 1685
repeater1.visible = false

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Brad Baker" <br**@nospam.nospam> wrote in message
news:O%****************@TK2MSFTNGP04.phx.gbl...
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

Apr 18 '06 #2
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.
Apr 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: clueless_google | last post by:
hello. i've been beating my head against a wall over this for too long. setting the variables 'z' or 'y' to differing numbers, the following 'if/else' code snippet works fine; however, the ...
3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
1
by: chris han | last post by:
Hi, all, I'm trying to use Conditional Compilation Statements in my code. using System; #define DEBUG public class MyClass { public static void Main() {
92
by: Raghavendra R A V, CSS India | last post by:
hie.. Do any one knows how to write a C program without using the conditional statements if, for, while, do, switch, goto and even condotional statements ? It would be a great help for me if...
10
by: nimmi_srivastav | last post by:
Below you will see an example of a nested conditional expression that this colleague of mine loves. He claims that it is more efficient that a multi-level if-else-if structure. Moreover, our...
0
by: Machi | last post by:
let say in parent-child scenerio (Product: Product Category - one product category may has many products), i am using nested repeaters where parent repeater will be used to display info and child...
10
by: Dave | last post by:
I'm a C++ programmer of many years, trying to get my feet wet in C#. I have a question about conditional compilation. In C++, I would sometimes define a constant in an include file, and then...
43
by: dev_cool | last post by:
Hello friends, I'm a beginner in C programming. One of my friends asked me to write a program in C.The purpose of the program is print 1 to n without any conditional statement, loop or jump. ...
1
by: andrew.douglas11 | last post by:
Hello all, Is it possible to share controls inside a child repeater? Here's the situation: I have a web page that needs to display data grouped by A, and alternatively by B (only one grouping...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.