
' style="color: #ff6600;"><%=strName_World%>游>
RadioButtonList事件:
protected void rdoMode_T_SelectedIndexChanged(object sender, EventArgs e)
{
ID_Area_Line();
}
部分代码:
public static string strID_World;
public static string strName_World;
public static string strID_Area;
public static string strName_Area;
public static string strUrl;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.PathInfo.Length != 0)
{
labID_Area.Text = Common.SqlSafety.CutBadStr(Request.PathInfo.Substring(1));
PageSetBind();
Navigation();
ID_Area_Place();
Mode_T();
Place_T();
ID_Area_Line();
}
}
}
protected void Mode_T()
{
string strSql = "select distinct a.ID_Mode, a.Name_Mode from Mode_T a inner join Line_T b on b.ID_Mode_Line like '%'+a.ID_Mode+'%' where b.ID_Area_Line like '%" + strID_Area + "%' ";
System.Data.DataSet ds = Maticsoft.DBUtility.DbHelperSQL.Query(strSql);
if (ds.Tables[0].Rows.Count > 0)
{
rdoMode_T.DataSource = ds;
rdoMode_T.DataValueField = "ID_Mode";
rdoMode_T.DataTextField = "Name_Mode";
rdoMode_T.DataBind();
rdoMode_T.Items.Insert(0, new System.Web.UI.WebControls.ListItem("不限", "0"));
rdoMode_T.SelectedIndex = 0;
}
}
本地很正常,上传到服务器后,选择RadioButtonList按钮会出现如下错误:
Object reference not set to an instance of an object.
或者
Invalid postback or callback argument. Event validation is enabled using
请问是什么原因??
第一个是未将对象引用到实例,
在事件 ID_Area_Line中出现null对蠢敏轮象,但是你又使用了此对象 这样就报错了
第二带信个时参数安全问题 需要将 enableEventValidation 设置成false,或者再使用postback、CallBack的地方 需拿薯要使用 ClientScriptManager.RegisterForEventValidation 进行注册.
看的头晕