开发者

Loading user control dynamically from handler, and passing property values

开发者 https://www.devze.com 2023-03-08 10:15 出处:网络
I\'m trying to load a user control using the following example: Load ascx via jQuery The example 开发者_JAVA技巧is using Page.LoadControl(String). I\'d like to load a control that has custom properti

I'm trying to load a user control using the following example: Load ascx via jQuery

The example 开发者_JAVA技巧is using Page.LoadControl(String). I'd like to load a control that has custom properties, is there a way to pass them using this method?

Thanks in advance.

PS, both the control and handler are new so I am able to start over with a different approach.

EDIT

OK, so I went about creating a class in the App_Code, and made my control inherit from it.

Created all properties as MustInherit in the base class. And then casted the return from LoadControl method to the BaseClass type, all properties are available.

I'm not sure if it's the cleanest solution or not though.


Loading Webcontrol dynamically and pass value

http://www.wikipad.info/Details.aspx?ID=71

0

精彩评论

暂无评论...
验证码 换一张
取 消