ImageButton, client-side scripts, autopostbacks

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

For performance purposes, I am using client-side scripts to show-hide (via css display: hide, display: block) several rows of a table depending on which imagebutton is clicked. Because of workplace standards I'm using vbscript on the client-side. The sub called hides the rows without problems, but an autopostback from the imagebutton causes the display property to reset and the rows reappear. Does anyone know a simple way to disable the autopostback on the imagebutton control? It doesn't appear to have an autopostback property to set to false....

tia,
Sue
 
Hi Sue,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to disable the postback of the
ImageButtion on the web form. If there is any misunderstanding, please feel
free to let me know.

As far as I know, AutoPostback property indicates whether an automatic
postback to the server will occur whenever the user modifies something in
the control and then tabs out of the control. However, we cannot set this
property for ImageButton, because we cannot change something in that
button.

As a web control running at server side, the ImageButton will postback
whenever you click it. So if you don't need the button to post back, please
try to use an HTML control instead. I think we can use Image in HTML
control to achieve this. It is an HTML control running at client side and
will not postback. We can run client side script when it is clicked. It can
also show a picture, so that will ge the same effect as ImageButton.

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top