Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Server Controls

0 views
Skip to first unread message

Rex the Strange

unread,
Apr 9, 2008, 1:13:06 PM4/9/08
to
Help, please.

Using the Web Site model I can include a custom server control by
putting it into my app_code directory and referencing it in my web
page, thusly:

<%@ register tagprefix='myprefix' namespace='local.namespace' %>

and could then use the control without compiling it into an assembly,
like so:

<myprefix:mytag runat='server' [blah blah blah] />

(where mytag is a control defined in the local.namespace namespace).

This doesn't seem to work in using the Web Application model. How can
I do this in a Web Application (without having to compile it into an
assembly - if possible)?

Tia,

rts.

Peter Bromberg [C# MVP]

unread,
Apr 9, 2008, 2:06:02 PM4/9/08
to
Try moving the class file out of the APP_CODE Folder and into the project.
But really, the whole purpose of a CustomControl is to be reusable across
solutions. So, you are better off making a separate control project and
compiling it, then set a reference to either the built control asssembly in
your /bin folder, or to the control project in your solution as a project
reference.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net

Rex the Strange

unread,
Apr 9, 2008, 2:16:21 PM4/9/08
to
On Apr 9, 12:06 pm, Peter Bromberg [C# MVP]
> > rts.- Hide quoted text -
>
> - Show quoted text -

I tried moving it out of the app_code folder (which is really
meaningless in a web app) but to no avail. I have my reasons for not
wanting to compile it into an assembly or have a single control
project, that being, that the control changes from application to
application and I need to keep each version for each app. But thanks
anyway.

Any other suggestions?

Rex the Strange

unread,
Apr 29, 2008, 4:46:46 PM4/29/08
to
> Any other suggestions?- Hide quoted text -

>
> - Show quoted text -

Anyone?

0 new messages