我写了这样的函数类public class CmpInfPackage
{
private string name;
private string cas;
private int recordsPerPage;
public CmpInfPackage( string n,string c,int r )
{
name = n; cas = c; recordsPerPage = r;
}
public string Name
{
get{return name;}
}
public string CAS
{
get{return cas;}
}
public int RecordsPerPage
{
get{return recordsPerPage;}
}
}然后在页面中调用它
Session["CmpInfPackage"] =
new Utility.CmpInfPackage( txtName.Text,txtCas.Text,Convert.ToInt32(drpr.SelectedItem.Text)) ;这应该没有问题的,可是它就是给我错误,c:\inetpub\wwwroot\sanqiweb\testCom.aspx.cs(63): 重载“CmpInfPackage”方法未获取“3”参数
但是参数就是三个啊!而且我把调用改为
Session["CmpInfPackage"] =
new Utility.CmpInfPackage( txtName.Text,txtCas.Text,10) ;
也是同样的错误,究竟是什么原因啊!谢谢了!
{
private string name;
private string cas;
private int recordsPerPage;
public CmpInfPackage( string n,string c,int r )
{
name = n; cas = c; recordsPerPage = r;
}
public string Name
{
get{return name;}
}
public string CAS
{
get{return cas;}
}
public int RecordsPerPage
{
get{return recordsPerPage;}
}
}然后在页面中调用它
Session["CmpInfPackage"] =
new Utility.CmpInfPackage( txtName.Text,txtCas.Text,Convert.ToInt32(drpr.SelectedItem.Text)) ;这应该没有问题的,可是它就是给我错误,c:\inetpub\wwwroot\sanqiweb\testCom.aspx.cs(63): 重载“CmpInfPackage”方法未获取“3”参数
但是参数就是三个啊!而且我把调用改为
Session["CmpInfPackage"] =
new Utility.CmpInfPackage( txtName.Text,txtCas.Text,10) ;
也是同样的错误,究竟是什么原因啊!谢谢了!
解决方案 »
- 我想在updatepanel中添加一个动态生成的TREEVIEW然后就要用timer定时刷新
- 这个控件怎么样?IntelliGrid表格控件(Web Grid)V1.0 For Asp.Net2.0,3.5
- asp.net2.0中在同一个项目中,程序怎样才能共同拥有
- 关于dropdownlist控件的重刷新问题?
- 输出html代码丢失字符问题
- 请问如何用JS将页面中某个表格另存为EXCEL?
- 菜了一问,中、英文网站的设计问题?
- 两页面之间的数据传送!(小小问题,不好意思)
- 请问:Control.OnPreRender怎么用?
- 如何把客户端script的信息传到服务器端?
- 运行asp.net出错
- 是 DataGrid 的显示样式的问题,请大家指教.
Session["CmpInfPackage"] = new Utility().CmpInfPackage( txtName.Text,txtCas.Text,10) ;
new Utility.CmpInfPackage( txtName.Text,txtCas.Text,Convert.ToInt32(drpr.SelectedItem.Text)) ;
是在什么事件里写的
this.Response.Write(txtName.Text + "|" + txtCas.Text + "|" + drpr.SelectedItem.Text);
this.Response.End();
private void Button1_Click(object sender, System.EventArgs e)
{
Session["CmpInfPackage"] =
new TestWebControls.CmpInfPackage( "123","345",12) ;
} private void Button2_Click(object sender, System.EventArgs e)
{
TestWebControls.CmpInfPackage objCmp = (CmpInfPackage)Session["CmpInfPackage"] ;
TextBox1.Text = objCmp.CAS+objCmp.Name+objCmp.RecordsPerPage.ToString ();
}