如何在单击下一个按钮时保留一个页面的值,然后单击后退按钮如何保留prevoius页面的值 [英] How to retain the value of one page when click on next button and on click on back button how to retain the value of prevoius page

查看:70
本文介绍了如何在单击下一个按钮时保留一个页面的值,然后单击后退按钮如何保留prevoius页面的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在单击下一个按钮时保留一个页面的值,然后单击后退按钮如何保留prevoius页面的值

How to retain the value of one page when click on next button and on click on back button how to retain the value of prevoius page

推荐答案

会话和Cookie可以用
Sessions and Cookies can be used


作为Reshma说你可以使用session(常用)



在第一页你存储的值为



as Reshma said u can use session ( commonly used )

in the first page u store the value as

Session["key1"]= "u can store any object here ";







在第二页你可以获得价值






in the second page u can get the value by

var anyobject = Session["key1"];





如果是数据表u可以将其转换为



if it is a datatable u can cast it as

var datatable = (DataTable)Session["key1"];





如果是是一个字符串值然后你可以使用像



if it is a string value then u can use like

var stringvalue  =  convert.ToString( Session["key1"]);







详细信息你可以使用以下链接:





http://www.aspdotnet-suresh.com/20 12/11 / aspnet-session-state-example-in-c-vbnet.html [ ^ ]


这篇关于如何在单击下一个按钮时保留一个页面的值,然后单击后退按钮如何保留prevoius页面的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆