在Aspx Page + AJAX Control Toolkit中绑定用户控件 [英] Bind User Control in Aspx Page + AJAX Control Toolkit
问题描述
我正在使用具有诸如
之类的属性的Usercontrol
Hi,
I am using Usercontrol which have property like
private string _requestid;
public String Requestid
{
get { return _requestid; }
set { _requestid = value; }
}
以及usercontrol的page_load.
现在我想从我的aspx页面绑定该属性,在该页面中我使用RowCommand方法进行gridview,在其中我找到了绑定该usercontrol的ID.
我在做
and also page_load of usercontrol.
now i want to bind that property from my aspx page where i have gridview with RowCommand method where i found id to bind that usercontrol.
and i m doing like
usercontrol.Requestid = e.CommandArgument.ToString()
我可以找到无法分配给usercontrol的
i can find
e.CommandArgument.ToString()
值bt.我也调试了整个代码,我发现先触发了usercontrol的页面加载事件,然后将属性分配给了多数民众赞成,这就是为什么问题来了.但我不知道如何解决.
谢谢任何答复.
value bt i cant assign to usercontrol. i have also debug whole code and i found page load event of usercontrol is fired first and then property is going to assigned thats why problem comes. but i dont know how to resolve it.
Thanx for any reply.
推荐答案
无论您在"PageLoad"事件上写什么,都将该代码写到"RequestID"的"Set"属性中. >
那应该可以解决您的问题.
What ever you are writing on "PageLoad" event, write that code in your "Set" property of "RequestID".
That should solved your problem.
我得到了解决方法....
我正在执行gridview的Rowcommand.
然后我正在分配,因此我的价值在某处更改了.
但是当我在gridview中执行了buttom click事件时...然后执行相同的过程...它可以找到...无论如何都需要thanx的帮助
I got solution....
i was doing Rowcommand of gridview.
and then i was assigning so i value was changed somehome.
but when i did buttom click event in gridview...nd then do the same process...it works find... anyways thanx for help
这篇关于在Aspx Page + AJAX Control Toolkit中绑定用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!