如何在使用C#的ASP.NET重新加载页面期间保留值? [英] How to retain the values during page re load in ASP.NET with C#?
本文介绍了如何在使用C#的ASP.NET重新加载页面期间保留值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望在asp.net中重新加载页面后保留该值。我尝试使用静态,会话等但仍然没有保留值。
我正在使用
重新加载同一页面
I want to retain the value after page reload in asp.net. I tried using static,session etc but still the values are not getting retained.
I am reloading the same page using
Response.AppendHeader("Refresh", "15");
< br $> b $ b
我的尝试:
代码如下:
What I have tried:
Code is as below:
Response.AppendHeader("Refresh", "15");
if (!Page.IsPostBack)
{
}
if (Session["Authenticationflag"] == null)
{
WindowsUserAuthentication();
Session["Authenticationflag"] = "1";
}
推荐答案
什么是视图状态及其在ASP.Net中的工作方式 [< a href =https://www.c-sharpcorner.com/UploadFile/225740/what-is-view-state-and-how-it-works-in-Asp-Net53/\"target =_ blanktitle = 新窗口> ^ ]
这篇关于如何在使用C#的ASP.NET重新加载页面期间保留值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文