|
楼主 |
发表于 2020-1-20 19:45:01
|
显示全部楼层
zhouji700我将我的写出来,你看看有什么地方不对
test.ascx
1.Textbox1
2.Botton
s
public string keyword
{
get { return TextBox1.Text; }
}
protected void Button1_Click(object sender, EventArgs e)
{
Server.Transfer("main.aspx");
}
================================
test.ascx 放入index.aspx页
<%@ Register Src="test.ascx" TagName="test" TagPrefix="uc1" %>
并在index.aspx.cs中
protected test myascx;
============================
main.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(myascx.keyword);
}
编译器错误信息: CS0103: 当前上下文中不存在名称“myascx”
|
|