如何在页面中存储值? [英] how to store a value in a page ?

查看:64
本文介绍了如何在页面中存储值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友



这里是问题



i必须存储一个值(项目)暂时在网页上。如果我去另一个页面并添加另一个值(项目)旧项目和新项目应该显示...如何实现



请告诉我代码

解决方案

您好,



您可以使用会话变量和查询字符串将值从一个页面传递到另一个页面。这将帮助您在其他页面中获取值。



  //  将会话设置为 
session [ Value1] = value ;

// 访问值
value = Convert.ToString(Seeeion [ Value1] );





对于查询字符串的使用,例如

使用QueryString在页面之间传递变量



谢谢


需要有关页面安全的信息 [ ^ ]



you可以使用Session对象...链接有适当的解决方案.. :))


hi friends

here is the problem

i have to store a value(item) for temporary in a webpage. if i go to another page and add another value (item) the old item and new item should display... how to implement

please show me code

解决方案

Hi,

you can pass the value from one page to another page using the session variable and query string. This will help you in getting the values in other page.

//Set the session like
session["Value1"] = value;

// Access the value like
value = Convert.ToString(Seeeion["Value1"]);



For query string use like
Passing variables between pages using QueryString

Thanks


need information about page security[^]

you can use Session object for that... Link has proper solution of it.. :)


这篇关于如何在页面中存储值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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