Hi all,
I have explicitly added __doPostBack() on Button onclientClick event .
<asp:Button ID="Button1" runat="server" Text="Button"
OnClientClick="__doPostBack('Button1','')"/>
When I am clicking the button the Page_Load is calling twice. But if I am adding below code inside page load ,page load is calling only once on button click.
Button1.Attributes.Add("onClientClick", "__doPostBack('Button1','')");
Again if i add with return false it is giving me it calling only once page load on click
<asp:Button ID="Button1" runat="server" Text="Button"
OnClientClick="__doPostBack('Button1','');return false;"/>
and return true is giving me again twice page load ,but adding return true or false in attribute.add code is giving the same result ,only one page load call.
Button1.Attributes.Add("onClientClick", "__doPostBack('Button1','');return true;");
I am not able to understand what is going on exactly when I tried to add __doPostBack in different way. Please help. Thanks