By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,835 Members | 1,488 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,835 IT Pros & Developers. It's quick & easy.

client side

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"=?Utf-8?B?cm9kY2hhcg==?=" <ro*****@discussions.microsoft.com> wrote in
news:3C**********************************@microsof t.com:
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.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
Nov 19 '05 #2

P: n/a
On Mon, 26 Sep 2005 17:14:50 +0000, Lucas Tam wrote:
"=?Utf-8?B?cm9kY2hhcg==?=" <ro*****@discussions.microsoft.com> wrote in
news:3C**********************************@microsof t.com:
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.

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.

Nov 19 '05 #3

P: n/a
how do i locate button and hide/show?

"intrader" wrote:
On Mon, 26 Sep 2005 17:14:50 +0000, Lucas Tam wrote:
"=?Utf-8?B?cm9kY2hhcg==?=" <ro*****@discussions.microsoft.com> wrote in
news:3C**********************************@microsof t.com:
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.

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.

Nov 19 '05 #4

P: n/a
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
"rodchar" wrote:
how do i locate button and hide/show?

"intrader" wrote:
On Mon, 26 Sep 2005 17:14:50 +0000, Lucas Tam wrote:
"=?Utf-8?B?cm9kY2hhcg==?=" <ro*****@discussions.microsoft.com> wrote in
news:3C**********************************@microsof t.com:

> 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.

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.

Nov 19 '05 #5

P: n/a
On Mon, 26 Sep 2005 13:24:03 -0700, Ryan Luan wrote:
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
"rodchar" wrote:
how do i locate button and hide/show?

"intrader" wrote:
> On Mon, 26 Sep 2005 17:14:50 +0000, Lucas Tam wrote:
>
> > "=?Utf-8?B?cm9kY2hhcg==?=" <ro*****@discussions.microsoft.com> wrote in
> > news:3C**********************************@microsof t.com:
> >
> >> 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.
> 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.
>
>

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!

Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.