Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
157
Submit Behavior of WebImageButton
posted

hi,

 how can i set the usesubmitbehavior = false in wenimagebutton, like we do in standard button control of ASP.Net.

 there is a property called autosubmit, if i make it to false, click event of the webimagebutton is not rising on server side.

Please reply ASAP.

thanks,

Rajvel

  • 28464
    posted

    If you place two asp:buttons on a single page, one with UsesSubmitBehaviour = False and the other True (the default) you will notice the following difference in they HTML rendering:

    <input type="button" onclick="BLOCKED SCRIPT__doPostBack('ctl02','')" value="UsesSubmitBehaviour  -  False" name="ctl02"/>

    input type="submit" id="Button1" value="UsesSubmitBehaviour  - True" name="Button1"/>

    So in essence, you just need to execute the same javascript from the client-side in order to emulate something like that on the server. The trick here is that "ctl02" is the client-side ID of the control and that you may need to handle the postback yourself by overriding the RaisePostBack event of the Page.