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
120
Question about Tab and ImageButton...
posted

Does anyone know if its possible add a Server Control ImageButton to a tab's little header portion? 

 J

  • 24497
    posted

    Hi,

    Tab labels do not support templates, however, you may set their Text which "contains" templates. For example, you may insert a button by something like

    <Tabs>
     
    <igtab:Tab Text="New Tab <input type='button' value='but' onclick='myClick()' />"></igtab:Tab>
     
     ...
    </Tabs>

    You may process that click event by following 

    function myClick()
    {
     
    var tb = document.getElementById('TextBox1');
      if(tb)
        tb +=
    'x'; //tb.value = 'postback by tab';
      __doPostBack('TextBox1');
    }

    So, now on server you at least will get postback. If you have somewhere on page TextBox1 and you process its TextChange event, then that handler also should be hit.

    Note: if you do similar, then there is no support in case of misbehavior or any side efffects.