JQuery + .NET + Ajax + Silverlight
I want to save the position of the dialogs on the page in the .net code behind.
i have placed this inside an ajax script
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger controlid="Button1" eventname="Click" />
</Triggers>
<ContentTemplate>
<asp:HiddenField ID="HiddenField1" runat="Server" Value="" />
<asp:Button ID="Button1" runat="Server" OnClick="hidden1_Click" Text="submit" />
</ContentTemplate>
</asp:UpdatePanel>
Every time the dialog is moved the porision is saved to HiddenField and the button is clicked from the within the java script
$(document).ready(function () {
$('.ui-dialog-titlebar').mouseup(function () {
var a = $('this').parent().children('.ui-dialog-title').html.valueOf;
document.getElementById("HiddenField1").value = (page + ";Left=" + $(this).parent().dialog('widget').position().left + ";Top=" + $(this).parent().dialog('widget').position().top);
document.getElementById("Button1").click();
});
});
The dialog contains silverlight objects that i pass vaiables to from the codebehind when the page first loads.
everything works excep when i minimize the dialog, then it seems to call the load the silverlight object again but now the variables is missing and it wont work.
The minimize worked fine when i didn't use the Ajax script on the page. and i added it becouse i didn't want the Silverlight object to reload every time the dialog was moved.
Does anyone know how i can prevent the silverlight object from unload/reload every time i hit the minimize button?