问题描述
我的信用卡类型,expmonth,expyear有三个下拉列表框.来自CCtype的数据来自表CCMast,对于expmonth和expyear,我编写了函数.
但是问题出在页面回发,然后CCtype将变为0或其索引变为0.每当页面回发一次又一次在这些dropdownboxes中添加的项目时,我就在页面加载.SO上声明了expmonth和expyear函数.那么,如何解决这些问题呢?
I have three dropdownlist box for creditcardtype,expmonth,expyear . Data from the CCtype come from table CCMast and for expmonth and expyear I write the function .
But the problem comes the page postback then CCtype will become 0 or its index become 0 . And i declared the expmonth and expyear function on page load .SO whenever page postback the items added again and again in these dropdownboxes. So how remove these problems
推荐答案
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//your code....
}
}
然后再试一次,希望它能解决您的问题..
或者即使继续进行,也请尝试
将所有下拉列表的自动回发属性设置为true而不是false.....
then try this again i hope it will solve your problem..
OR even if it continues then try this
set all drop down''s auto post back property to true instead of false.....
这篇关于回传后下拉索引变为0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!