Hello All,
I have one page which have a one image button and one button control and two check box below is my code..
var flag_used;
window.onbeforeunload = function (oEvent) {
if (!oEvent) oEvent = window.event;//FF & IE support
if (flag_used)
return message;
}
function Test()
{
flag_used = true;
}
<asp:UpdatePanel ID="uxscr" runat="server">
<ContentTemplate>
<TTI:TTICheckbox ID="chkmale" runat="server" Text="Male" onclick="Test();" />
<TTI:TTICheckbox ID="chkfemale" runat="server" Text="FeMale" onclick="Test();" />
<asp:ImageButton ImageUrl="../1.gif" runat="Server" PostBackUrl="~/default.aspx" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="btn1" runat="server" OnClick="btn_OnClick" Text="click"/>
//Code behind page i have define one btn_Click event
Now, When i click on check box flag_used makes "true" then after i have click on image button confrim message open then i have click on cancle button and hit submit on button click(ID of control is btn1 which define outside update)
//Output:-
what happen instead of fire the click event of button they navigate to default.aspx page.
so can you please help me as soon as possible how can i fire button click event on page?
Thanks in advance,