Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How would you do this...?(dont need code..just technique)

Status
Not open for further replies.

RhythmAddict112

Programmer
Jun 17, 2004
625
US
Hi all..New to .net, not new to ASP....
I'm tryin to see how you seasoned .net developers would deal with requirement I have here.

I need to create a radio button list..When a user puts their mouse pointer over a radio button or its description, I need to display a DIV. If that radio button is selected, I want to only display that DIV.

With classic ASP, I'd get some Javascript functions to do this for me, and trigger one onMouseOver, and one onClick inside of the <input> tag. How would you do this?

My initial effort was to do something simliar, but I cannot add a onClick event to the <asp:listitem> control...any ideas on how to accomplish my objective appreciated.

Use your resources, you're on the internet!
 
what you should be able to do is to use
yourListItem.Attributes.Add("onClick", "what ever needs to be done");

 
Hi Husein,
In the above code you have "yourListItem" I am able to provide the entire list with an ID, however since I cannot provide each :listItem with an ID, I'm not sure how I would do that...

I need provide different params to the JS function for each listItem

Code:
						<asp:RadioButtonList id="list" Runat="server" AutoPostBack="False">
							<asp:ListItem Value="Admin" />
							<asp:ListItem Value="Artwork / Signage / Whiteboards" />
							<asp:ListItem Value="Audio / Visual" />
							<asp:ListItem Value="Cafe / Vending" />
							<asp:ListItem Value="Doors" />
							<asp:ListItem Value="Furniture" />
							<asp:ListItem Value="General Maintenance" />
							<asp:ListItem Value="HVAC" />
							<asp:ListItem Value="Janitorial" />
							<asp:ListItem Value="Landscaping" />
							<asp:ListItem Value="Lights" />
							<asp:ListItem Value="Moves" />
							<asp:ListItem Value="Parking" />
							<asp:ListItem Value="Security / Safety" />
							<asp:ListItem Value="Utilties" />
						</asp:RadioButtonList>

Use your resources, you're on the internet!
 
RhythmAddict112,

I might not be completely helpful to you as I cannot simulate your problem. What I could suggest to you is this:

ListItems are members of RadioButtonList. Try accessing them using a foreach (C#) or For Each (VB.NET) loop or try obtaining a reference to IEnumerator interface and then casting to ListItem and for each listitem call attributes.add method. Sorry I cannot be more clear and to show you with an example right now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top