Radio Button Visibility

B

BigRed

Hi. I have 2 radio buttons on my vb.net web form, and
needed to show/hide them at some point in time, so I
wrapped a DIV tag around each. On the HTML side I have
it set to hidden whenever the page loads. My problem now
is getting the buttons to be "visible" on the server
side. In my code I have declared my div control:

Protected WithEvents divAdd As
System.Web.UI.HtmlControls.HtmlGenericControl

Then in my BuildGrid procedure (after the page loads but
before my grid is shown) I have this:

divAdd.Attributes.Add("Display", "Inline")

I have also set my div tag to runat="server".

I know this is not an HTML forum, (and all my html side
code works fine), but I can't get it to work on the
server side.

Does anyone have any advice?

Thanks in advance for ANY help!

BR
 
C

Cor

Hi BigRed,

I asume you use a serverside radio button.

I would not wrap it in a div tag, but use in the aspx.vb
radiobutton1.visible = true or radiobutton1.visible = false

Works a lot easier.

(Did you see the attributes method)
\\
TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost from
text box!!');"
//

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top