标签,下拉在ajax调用期间变为null? [英] label , drop down becomes null during ajax call?
本文介绍了标签,下拉在ajax调用期间变为null?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hii,
在页面加载时我正在触发methiod,它为控件,标签,下拉列表和其他东西设置值。
i正在从其他链接调用其他ajax调用,而webmethod再次调用我的第一个方法,但这次..all控件变为null并且无法设置值并且将错误对象引用设置为未设置为对象的实例
Hii ,
On page load i am firing methiod which sets value to controls , labels , dropdown and other things ..
i am making other ajax call from other link , and that webmethod again calling my first method , but this time ..all controls gets null and not be able to set value and throwing an error object reference not set to instance of an object
推荐答案
将您的page_load代码放入if(!IsPostBack)
Put your page_load code inside "if(!IsPostBack)"
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//Your Code to set value to control
}
}
这篇关于标签,下拉在ajax调用期间变为null?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文