私はすでにこの記事を見つけました:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=181&AspxAutoDetectCookieSupport=1
しかし、私は別の状況にあります。マスター ページ内にいくつかの hiddenFields を埋め込み、dragPanel の位置をそれらに格納しようとしています。
javascript を使用して dragPanel の位置を保存しています。ユーザーがリンクをクリックすると、新しいページが読み込まれますが、dragPanel は開始位置にリセットされます。
これを行う簡単な方法はありますか?
擬似コード:
**this is in MasterPage.master**
function pageLoad()
{
// call the savePanelPosition when the panel is moved
$find('DragP1').add_move(savePanelPosition);
var elem = $get("<%=HiddenField1.ClientID%>");
if(elem.value != "0")
{
var temp = new Array();
temp = elem.value.split(';');
// set the position of the panel manually with the retrieve value
$find('<%=Panel1_DragPanelExtender.BehaviorID%>').set_location(new
Sys.UI.Point(parseInt(temp[0]),parseInt(temp[1])));
}
}
function savePanelPosition()
{
var elem = $find('DragP1').get_element();
var loc = $common.getLocation(elem);
var elem1 = $get("<%=HiddenField1.ClientID%>");
// store the value in the hidden field
elem1.value = loc.x + ';' + loc.y;
}
<asp:Button ID="Button1" runat="server" Text="Button"/>
<asp:HiddenField ID="HiddenField1" runat="server" Value="0"
ただし、リダイレクトされたページfoo.aspx にはHiddenFieldは表示されません。