client side

G

Guest

hey all,

i have a datagrid with checkboxes on it and i was wondering if i can do the
following:
if a user clicks on the checkbox it makes a server-side button visible.

can i make this happen on the client side without posting back?

thanks,
rodchar
 
L

Lucas Tam

i have a datagrid with checkboxes on it and i was wondering if i can
do the following:
if a user clicks on the checkbox it makes a server-side button
visible.

can i make this happen on the client side without posting back?

No, if you make a button NOT visible on the server side, the button is not
outputted in the HTML.

If you wish to hide the button and allow clientside script to access it,
use DHTML on the serverside to hide the button.
 
I

intrader

No, if you make a button NOT visible on the server side, the button is not
outputted in the HTML.

If you wish to hide the button and allow clientside script to access it,
use DHTML on the serverside to hide the button.
The last phrase is bound to be confusing; there is NO DHTML serverside.
What need to be done is assure that the button is is always output to the
client (this is done via setting visible at the server), then at the
client locate the button via the id assigned to it, then hide/show as
desired.
 
G

Guest

how do i locate button and hide/show?

intrader said:
The last phrase is bound to be confusing; there is NO DHTML serverside.
What need to be done is assure that the button is is always output to the
client (this is done via setting visible at the server), then at the
client locate the button via the id assigned to it, then hide/show as
desired.
 
G

Guest

As Lucas pointd out, don't use buttonName.Visible = false on the server side
to hide the button. On the client side, use javascript to hide/show this
button, something like pageName.buttonName.style.visibility='hidden'

Regards,
Ryan
 
I

intrader

As Lucas pointd out, don't use buttonName.Visible = false on the server side
to hide the button. On the client side, use javascript to hide/show this
button, something like pageName.buttonName.style.visibility='hidden'

Regards,
Ryan
Ryan Luan has given you the code to hide/show. The code to determine the
buttonName is based on the ClientID (the id assigned at the server to the
button at the client). By the way don't confuse ClientID with the ID
attibute used in the server; these are distinct. It also gets a little
more confusing if you consider that each button will have a UniqueID (a
hierarchically-qualified ID for the control); this is so that the all
controls have unique names!. Now the 'buttonName' can be determined as
easy as 'this.ID' (at the server).
I hope that I have not confused the issue!
 

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

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top