大哥们帮帮忙,无刷新的问题!!!谢谢了!!!
我调用了个RelatedList控件 在测试的过程中来出现“未将对象引用设置到对象的实例”using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class lx : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)---------这一块的问题出现“未将对象引用设置到对象的实例”,帮忙看看,谢谢!!!!
{
ArrayList a = new ArrayList();
a.Add("DropDownList1");
a.Add("DropDownList2");
a.Add("DropDownList3");
a.Add("DropDownList4");
RelatedList1.DataSource = @"ArticleCategory.xml";
RelatedList1.ListID = a;
RelatedList1.DataBind();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(DropDownList1.SelectedItem.Value + "|" + DropDownList1.SelectedItem.Text + "<br>");
Response.Write(DropDownList2.SelectedItem.Value + "|" + DropDownList2.SelectedItem.Text + "<br>");
Response.Write(DropDownList3.SelectedItem.Value + "|" + DropDownList3.SelectedItem.Text + "<br>");
Response.Write(DropDownList4.SelectedItem.Value + "|" + DropDownList4.SelectedItem.Text + "<br>");
}
}
--------------------编程问答-------------------- RelatedList1.DataSource = @"ArticleCategory.xml";
RelatedList1.ListID = a;
RelatedList1.DataBind();
这3行注释掉就好? --------------------编程问答-------------------- 郁闷,不行还是老问题,错误提示使用new 关键字创建对象实列
--------------------编程问答-------------------- RelatedList1.DataSource = @"ArticleCategory.xml";
RelatedList1.ListID = a;
RelatedList1.DataBind();
----------------------------
RelatedList1.DataSource = a;
RelatedList1.DataBind(); --------------------编程问答-------------------- 帮顶了 --------------------编程问答-------------------- 请求帮忙!!!!谢谢了 --------------------编程问答-------------------- 没人,帮忙吗? 顶上去 --------------------编程问答-------------------- 友情帮顶! --------------------编程问答-------------------- 路漫漫啊!!!!帮忙 --------------------编程问答-------------------- 有没有人帮帮忙啊 --------------------编程问答-------------------- 有没有人帮忙啊 --------------------编程问答-------------------- 加入ASP。NET C#群吧,群号是: 1873156
补充:.NET技术 , ASP.NET