Wednesday, March 21, 2012

Use Ajax controls within web control

Is there any example that show how to write a custom web control (one that doesn't have aspx) and use Ajax controls ?

I have a user control consisting of a panel the modalpopupextender. I have a copy of the aspx and .cs file in all the sites. I want to turn it into a control so I can re-use it. How can I achive it?

Hi Thanhhuynh,

Basically, you can drag it into your customer control without doing any other special settings. Ajax Control Toolkits work depend on ScriptManager or ToolkitScriptManager. Please make sure that the ScriptManager should be located before the extender and inside a page there should be only one ScriptManager. To create customer control , here are two samples(sample1 andsample2).

I hope this help.

Best regards,

Jonathan


Thanks for answering.

Basically there are two type of controls I can create: web control and web user control. The former contains only code. There's no UI designer support where you can drag and drop different controls into it. You can to override the RenderXX() methods to create the look. The web user control has the UI part and the code behind and you can design right on the screen. But web user can only be used within the same web site. You have to copy the aspx and code-hind files to another web site source tree in order to re-use it.

So my question was let's say I create a new control, without VS UI designer how can I use the AJAX extender ?

Thanks


I believe the answer you are looking for is in this blog post by David Ebbo:http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx

Good luck,

Hanan Schwartzberg
---------------
http://www.lionsden.co.il

No comments:

Post a Comment