asp.net 临时数据保存实现代码

时间:2022-09-17 20:24:42

如果你感觉有用的话拷 
走的时候顺便顶一下! 

复制代码代码如下:


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