Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Losing clientside script hooks of telerik window on second rendering
- @model HitaishiWeb.ViewModels.DialogViewModel
- <script type="text/javascript" src="../../Scripts/hitaishi.dialog.js"></script>
- @{ Html.Telerik().Window()
- .Name("Window")
- .Title(Model.Title)
- .Draggable(false)
- .Resizable(resizing => resizing.Enabled(false))
- .Modal(true)
- .Buttons(buttons => buttons.Close())
- .Content(@<text>
- @Model.Content <br/><br/>
- <button id='okButton' class='t-button t-state-default'>Close</button>
- </text>)
- .Width(Model.Width)
- .Height(Model.Height)
- .ClientEvents(events=>events
- .OnClose("onCloseWindow")
- .OnLoad("onLoadWindow"))
- .Render();
- }
- @Html.Hidden("ReturnPath", Model.ReturnPath);
- function onLoadWindow() {
- var window = $("#Window").data("tWindow");
- window.center();
- $('.t-button').live('mouseenter', $.telerik.buttonHover).live('mouseleave', $.telerik.buttonLeave);
- $("#okButton").click(function (e) {
- e.preventDefault();
- window.close();
- });
- }
- function onCloseWindow() {
- //$("#adminContent").load($("#ReturnPath").attr("value"));
- $.ajax({
- cache: false,
- ifModified: false,
- url: $("#ReturnPath").attr("value"),
- success: function (data) { $("#adminContent").html(data); }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment