Asp.Net降低选定的指数变化 [英] Asp.Net Drop Down Selected Index Change

查看:53
本文介绍了Asp.Net降低选定的指数变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在类级别声明变量并在该变量上确定一些值。

DropDown选择索引更改事件,当我单击提交按钮时,变量确实为
不包含任何价值。



任何人都可以解释一下这可能是什么问题。



谢谢提前....

I am declaring a variable at class level and assining some value to that variable on
DropDown Selected Index Change event and when i click on submit button the variable does
not contain any value.

Can any one explain me what could be the issue.

Thanks in advance....

推荐答案

嗨Susheel



你可以使用Session来存储每个用户,所以它将在您的所有页面中访问。



另一方面,如果只是在特定页面上需要它,你可以将它保存在ViewState中并可以在回发中获取它。



或者你可以使用静态变量。



问候

Willington
Hi Susheel

You can use Session to store per user, so it will be accessible in all your pages.

On the other hand, if just need it on a specific page, you can save it in ViewState and can get it in post back.

Or you can use static variable.

Regards
Willington


尝试使用ViewState(VS_Name)。它与变量相同。



例如:



ViewState(Name)= Vardhan Desai



txtName.Text = ViewState(Name)
Try usong ViewState("VS_Name"). It is same as varible only.

For eg:

ViewState("Name")="Vardhan Desai"

txtName.Text=ViewState("Name")


这篇关于Asp.Net降低选定的指数变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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