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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button-Style radio buttons

Status
Not open for further replies.

JCruz063

Programmer
Feb 21, 2003
716
US
Hello all,
I need to change the appearance of radio buttons that I used on my web forms. Instead of using a circle with a dot inside, I need them to look like regular (push) buttons that look pressed when the option is selected, and unpressed when the user deselects the option.

In Visual Studio 6.0, radion buttons have a property that does exactly that.

How would I go about getting my radio buttons to behave that way?

And, they don't really need to be radio buttons. I was thinking, for instance, about having images that are toggled when clicked. I would keep track of the selected item using javascript and I'm done.

Can anyone suggest how I should accomplish this?

Thanks.

JC

_________________________________
I think, therefore I am. [Rene Descartes]
 
I'm not 100% sure, but I think you'll have to create a custom control to achieve this functionality.
 
nope, event that is not possible,

.NET has to finally output only HTML, and in HTML u cannot create that effect without having images with rollover effects using Javascript(in which case it ceases to be a control)...

Known is handfull, Unknown is worldfull
 
Thanks guys!
I used regular buttons. When the buttons are clicked, I use javascript to change their backcolor, simulating a hilighted/selected button.

There is one problem though. After the user has selected the button of his choice, he can click on a button that redirects him to another page whose contents are based (among other things) on the selected button.

The user may want to go back to the original page to make a different selection, though. When the user goes back, the original page should show the selections he made before, and so I must restore whatever button was hilighted before he moved from the original page. To do this, I have a link on the new page that says something like "back to other page" which takes the user back to the original page, and then, I simply use the Page_Load event and Session variables to restore what the user had previously selected.

Great! The only problem is, there exists the good old browser 'Back' button which, when pressed, does not cause the Page_Load event to fire, and the changes that were made to the page by javascript (i.e. hiligthing a button) are lost.

What can I do so that the changes made through javascript to a page get restored when the user (after being moved to another page) comes back to that page using the browser's back button?

I'm using Visual Studio .NET 2002 with C#, running on a Windows 2000 machine with IE 6.

Thanks.

JC

_________________________________
I think, therefore I am. [Rene Descartes]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top