怎么把用户控件的执行结果写到变量里? 用户控件写到变量里?和你说的有啥关系?你在控件里定义一个属性public string result{get;set;}结果附给属性, result="???"然后在外层使用 控件名.result 就可以抓到了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 什么结果,生成的html代码吗?如果是用HtmlTextWrite去做.控件.RenderControl(Writer 这是我测试成功过的例子:用户控件TestUserControl.aspx.cs private int _ID = 1; public int ID { set { _ID = value; } get { return this._ID; } } protected void Page_Load(object sender, EventArgs e) { Response.Write(_ID);//测试传进来的值 }传值页面TestUserControl.aspx <%@ Reference Control="~/webUserControl.ascx" %> <%--在页头加这一句代码--%>TestUserControl.aspx.cs protected void Page_Load(object sender, EventArgs e) { Control c1 = Page.LoadControl("WebUserControl.ascx"); PlaceHolder1.Controls.Add(c1); WebUserControl w1 = (WebUserControl)c1; w1.ID = 2300; //这里设置用户控件的_ID的值 } 此种环境下使用神马好?DES 还是 RSA 无法获取 IIS 拾取目录。 什么时候会用到HttpModule? VS2008自带的menu控件,如何支持iframe? 急!! 页面中获取用户控件中ListBox信息时,提示"未将对象引用设置到对象的实例" 从URL加载XmlDataDocument后显示到datagrid中 请教如何实现自动邮件 <asp:boundcolum>如何格式化? 页面传递值的问题 Asp.Net开发的网站,会对浏览器端的Framework版本有要求吗 重写抽像类的方法能写静态的吗 跪求asp可以调用asp.net吗?
控件.RenderControl(Writer
{
set
{
_ID = value;
}
get
{
return this._ID;
}
} protected void Page_Load(object sender, EventArgs e)
{
Response.Write(_ID);//测试传进来的值
}传值页面TestUserControl.aspx <%@ Reference Control="~/webUserControl.ascx" %> <%--在页头加这一句代码--%>
TestUserControl.aspx.cs protected void Page_Load(object sender, EventArgs e)
{
Control c1 = Page.LoadControl("WebUserControl.ascx");
PlaceHolder1.Controls.Add(c1);
WebUserControl w1 = (WebUserControl)c1;
w1.ID = 2300; //这里设置用户控件的_ID的值
}