在Aspx Page + AJAX Control Toolkit中绑定用户控件

编程入门 行业动态 更新时间:2024-10-24 08:30:54
本文介绍了在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中绑定用户控件

本文发布于:2023-11-25 02:09:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627888.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:绑定   控件   用户   Page   Aspx

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!