Last post Nov 14, 2006 01:23 PM by arnold4sho
Jun 26, 2006 01:35 AM|avarair|LINK
I created a web control library project using vs2k5(New Project-> Visual C# - Windows ->Web Control Library), & it didn't give me an option of creating .ascx file, or Web User Control - the only web custom control it offer is the one inheritting from WebContro
& with no design mode.
So I copy/pasted my custom user control which is two files: Confirmation.ascx & Confirmation.ascx.cs:
First one is very concise:
Second one would be:
When I build this project I put the dll file into a my web applications bin directory, so I would be able to use the custom web control I created. It works fine, but it doesn't show the content from ascx file, e.g. it ignores it somehow, probably due to
compilation. I tried to change the build action for the Confirmation.ascx file to Embedded Resource & it still builds my solution. But when I try to change the build action for the same file to compile it gives me this message:
''Confirmation' does not contain a definition for 'Context'
Is there a way to have a separate web control library, with ascx files, design them, write code for code-behind file, package it into .dll assembly, drop the assembly into my WEB site project & have it rendered as normal.
What would be the point of not being able to develop a web control library if you can't use the designer. Or if for my case: if I can use the designer, why would vs2k5 not compile my files as it normaly would in web site projects.
Thanks a lot,
Jun 26, 2006 04:56 PM|Mikhail Arkhipov (MSFT)|LINK
Jun 26, 2006 04:58 PM|Mikhail Arkhipov (MSFT)|LINK
Jun 26, 2006 05:14 PM|avarair|LINK
thanks for the replies.
I figured that I'd better derive from WebControl, rather than UserControl, since that's what is recommended, or whatever I could find from msdn.
But my question remains this: Can I use(VS2K5) visual designer & code-behind file outside Web Site Project for creating custom web controls( in one dll), compile them into assembly, then use the assembly in a web site project, then in the web site project
also be able to modify the custom control & it's properties using design & code-behind modes. If not, what is the Web Control Library concept good for?
Jun 26, 2006 05:31 PM|Mikhail Arkhipov (MSFT)|LINK
Nov 14, 2006 01:23 PM|arnold4sho|LINK
How do you include ascx ajax components in an aspx. What must be typedinto the aspx files to run the ajax functions of the ascx component. I have tried as many possiblities as i know but none of them have worked out for me..