asp.net 临时数据保存实现代码
程序员文章站
2024-03-07 08:45:02
如果你感觉有用的话拷 走的时候顺便顶一下! 复制代码 代码如下: public mainpage() { initializecomponent(); } phoneapp...
如果你感觉有用的话拷
走的时候顺便顶一下!
public mainpage()
{
initializecomponent();
}
phoneapplicationservice phoneappservice = phoneapplicationservice.current;
protected override void onnavigatedfrom(system.windows.navigation.navigationeventargs e)
{
phoneappservice.state["myvalue"] = textbox1.text;
base.onnavigatedfrom(e);
}
protected override void onnavigatedto(system.windows.navigation.navigationeventargs e)
{
object someobject;
if (phoneappservice.state.containskey("myvalue"))
{
if (phoneappservice.state.trygetvalue("myvalue", out someobject))
{
textbox1.text = someobject.tostring();
}
}
base.onnavigatedto(e);
}
作者:mastermeng
走的时候顺便顶一下!
复制代码 代码如下:
public mainpage()
{
initializecomponent();
}
phoneapplicationservice phoneappservice = phoneapplicationservice.current;
protected override void onnavigatedfrom(system.windows.navigation.navigationeventargs e)
{
phoneappservice.state["myvalue"] = textbox1.text;
base.onnavigatedfrom(e);
}
protected override void onnavigatedto(system.windows.navigation.navigationeventargs e)
{
object someobject;
if (phoneappservice.state.containskey("myvalue"))
{
if (phoneappservice.state.trygetvalue("myvalue", out someobject))
{
textbox1.text = someobject.tostring();
}
}
base.onnavigatedto(e);
}
作者:mastermeng