How do I handle a server-side click event for a button within a Kendo UI window?
My problem is that whenever I click on button "btnLogoutConfirmOK" (see code below), nothing happens.
Here is the markup for my window:
Here is the script that opens the KendoUI window:
and here is the server-side event handler for button "btnLogoutConfirmOK":
My problem is that whenever I click on button "btnLogoutConfirmOK" (see code below), nothing happens.
Here is the markup for my window:
<
div
id
=
"dialogLogoutConfirm"
class
=
"Dialog"
style
=
"display: none"
>
<
br
/>
<
div
style
=
"height: 20%; text-align: center"
>
<
asp:Label
ID
=
"lblLogoutConfirm"
runat
=
"server"
CssClass
=
"label-dialog"
Text
=
"Sign out of DMS?"
></
asp:Label
>
</
div
>
<
br
/>
<
br
/>
<
div
style
=
"text-align: center;"
>
<
asp:Button
ID
=
"btnLogoutConfirmCancel"
runat
=
"server"
Text
=
"No"
Width
=
"100px"
/>
<
asp:Button
ID
=
"btnLogoutConfirmOK"
runat
=
"server"
Text
=
"Yes"
Width
=
"100px"
/>
</
div
>
</
div
>
Here is the script that opens the KendoUI window:
$(
"#dialogLogoutConfirm"
).kendoWindow(windowOptions);
$(
"#<%=imgLogout.ClientID %>"
).click(
function
() {
var
window = $(
"#dialogLogoutConfirm"
).css(
"display"
,
"block"
).data(
"kendoWindow"
);
var
title = window.wrapper.find(
'.k-window-title'
);
title.html(
'<label style="font-size: large; color: #0; text-align:center;"><b>Sign Out</b></label>'
);
$(
"#<%= btnLogoutConfirmCancel.ClientID%>"
).bind(
"click"
,
function
() {
window.close();
return
false
;
});
window.center();
window.open();
return
false
;
});
and here is the server-side event handler for button "btnLogoutConfirmOK":
Protected
Sub
btnLogoutConfirm_Click(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
btnLogoutConfirmOK.Click
Dim
us
As
UserSession = UserSession.Retrieve(Session(
"intUserSessionId"
))
With
us
.SessionLogoutDate = DateTime.Now
.Update()
End
With
Session(
"intAgentID"
) =
Nothing
Session(
"intUserID"
) =
Nothing
Session(
"UserSecurityTask"
) =
Nothing
Session(
"GlobalSearchCriteria"
) =
Nothing
Response.Redirect(
"~/Login.aspx"
)
End
Sub