Monday, March 26, 2012

Access User Controls in Web Service

Hello all,

We have a custom control that has many custom properties and methods. Currently this control is being loaded through the Master page and it is working just fine. Now there is a need to load this control through a web service.

Since the control needs to be loaded through a web service, the web service does not have any information on this custom control and its properties/methods. We can only load this custom control as a System.Web.UI.UserControl, and we cannot also cast this UserControl as a custom control because the web service does not know anything about this custom control.

I read this article about rendering user controls through web service by Scott Gutherie but it only talks about user control and not custom controls and custom properties and methods.

http://weblogs.asp.net/scottgu/archive/2006/10/22/Tip_2F00_Trick_3A00_-Cool-UI-Templating-Technique-to-use-with-ASP.NET-AJAX-for-non_2D00_UpdatePanel-scenarios.aspx

Does anybody have any ideas on how to access the custom control in a web service?

Thanks.

Hi,

For custom control, it's necessary to add reference to it in the web application. And instantiate it with its actual constructor.

Then, you may render it in a similar way as Scott Gutherie has shown.

1 comment:

Unknown said...

Hi,Several WYSIWYG (What you see if what you get) HMTL editors are available to help create Web pages in Web Design Cochin. Using these HTML editors, a designer can create Web pages without having to learn actual html coding. Microsoft FrontPage and Macromedia DreamWeaver are two of the most popular and powerful HTML editors.Thanks.................

Post a Comment