Wednesday, September 28, 2011

Dopostback event coding if it doPostBack not available


<script type="text/javascript">
         //<![CDATA[
        
        
         function __doPostBack(eventTarget, eventArgument)
         {
             var theForm = document.getElementById("<%=form1.ClientID %>");
             if (!theForm.onsubmit || (theForm.onsubmit() != false))
             {
                 theForm.__EVENTTARGET.value = eventTarget;
                 theForm.__EVENTARGUMENT.value = eventArgument;
                 theForm.submit();
             }
         }
         //]]>
</script>

    <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />