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 except when i minimize the dialog, then it seems to try and reload the silverlight object again but now the variables is missing and it wont work.
The minimize worked fine with the Sl objects when i didn't use the Ajax script on the page. and i added it becouse i didn't want the page to reload every time the dialog was moved.
1) Does anyone know how i can prevent the aspx page from unload/reload every time i hit the minimize button?
2) or does anyone know of another way to save the position to codebehind after every mouseup event on the dialogs (i'm going to update the database every time a new position is saved)?
Edit: it seems to work in Firefox, but not in IE when im debugging in VS2010
Thanks!