469,592 Members | 1,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

if the custom control is in App_Code folder, than what will be it's assembly name in the <%@register %> Asp.Net 2.0

I know that, in asp.net 2.0, the assembly for the web site is splitted into
pieces and each time you build it, it generates a random name for assembly.

My question is, if i create a custom web control under the App_Code folder,
how can i add a register tag on a page.

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo" Assembly="???????????????"
%>

My other question is "Since i don't know the name of the assembly of the
asp.net 2.0 web site, how can dynamically load that assembly using the
Assembly.CreateFromFile () method??

Thank you
Dec 21 '05 #1
8 6167
Use "__code":

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo" Assembly="__code" %>

-Brock
DevelopMentor
http://staff.develop.com/ballen
I know that, in asp.net 2.0, the assembly for the web site is splitted
into pieces and each time you build it, it generates a random name for
assembly.

My question is, if i create a custom web control under the App_Code
folder, how can i add a register tag on a page.

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo"
Assembly="???????????????" %>

My other question is "Since i don't know the name of the assembly of
the asp.net 2.0 web site, how can dynamically load that assembly using
the Assembly.CreateFromFile () method??

Thank you

Dec 22 '05 #2
Thank you so much.

How can i load that assembly on the fly using
Assembly.LoadFrom ()
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:b8**************************@msnews.microsoft .com...
Use "__code":

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo" Assembly="__code" %>

-Brock
DevelopMentor
http://staff.develop.com/ballen
I know that, in asp.net 2.0, the assembly for the web site is splitted
into pieces and each time you build it, it generates a random name for
assembly.

My question is, if i create a custom web control under the App_Code
folder, how can i add a register tag on a page.

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo"
Assembly="???????????????" %>

My other question is "Since i don't know the name of the assembly of
the asp.net 2.0 web site, how can dynamically load that assembly using
the Assembly.CreateFromFile () method??

Thank you


Dec 22 '05 #3
Why would you need to manually load the assembly? Just call "new" on the
control/class defined in the App_Code directory.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Thank you so much.

How can i load that assembly on the fly using
Assembly.LoadFrom ()
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:b8**************************@msnews.microsoft .com...
Use "__code":

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo" Assembly="__code" %>

-Brock
DevelopMentor
http://staff.develop.com/ballen
I know that, in asp.net 2.0, the assembly for the web site is
splitted into pieces and each time you build it, it generates a
random name for assembly.

My question is, if i create a custom web control under the App_Code
folder, how can i add a register tag on a page.

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo"
Assembly="???????????????" %>
My other question is "Since i don't know the name of the assembly of
the asp.net 2.0 web site, how can dynamically load that assembly
using the Assembly.CreateFromFile () method??

Thank you

Dec 22 '05 #4
I have a custom control on a seperate assembly. I give a reference to that
custom control from web site. This web control loads "custom controls" that
are under the app_code folder. Maybe i am not clear but, i definetely need
to find a way to load them.

This is the inside of the load method. This was valid at 1.1. It is no more
valid at asp.net 2.0

// The assembly will be searched in the bin folder of the application

string path = AppDomain.CurrentDomain.BaseDirectory + "bin" + "/" +
cstModule.Assembly + ".dll";

// Load assembly

ass = Assembly.LoadFrom(path);

// Load control from assembly

control = (System.Web.UI.Control)ass.CreateInstance(cstModul e.TypeName);


"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:b8**************************@msnews.microsoft .com...
Why would you need to manually load the assembly? Just call "new" on the
control/class defined in the App_Code directory.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Thank you so much.

How can i load that assembly on the fly using
Assembly.LoadFrom ()
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:b8**************************@msnews.microsoft .com...
Use "__code":

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo" Assembly="__code" %>

-Brock
DevelopMentor
http://staff.develop.com/ballen
I know that, in asp.net 2.0, the assembly for the web site is
splitted into pieces and each time you build it, it generates a
random name for assembly.

My question is, if i create a custom web control under the App_Code
folder, how can i add a register tag on a page.

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo"
Assembly="???????????????" %>
My other question is "Since i don't know the name of the assembly of
the asp.net 2.0 web site, how can dynamically load that assembly
using the Assembly.CreateFromFile () method??

Thank you


Dec 22 '05 #5
By the way, it gives an error for _code

<%@ Register Assembly="_code" Namespace="A" TagPrefix="abc" %>

Error 3 Could not load file or assembly '_code' or one of its dependencies.
The system cannot find the file specified. C:\Documents and
Settings\utezduyar\My Documents\Visual Studio
2005\WebSites\WebFrameworkTestSite\Default.aspx 2
"Umut Tezduyar" <um**@tezduyar.com> wrote in message
news:eJ*************@TK2MSFTNGP09.phx.gbl...
I know that, in asp.net 2.0, the assembly for the web site is splitted into
pieces and each time you build it, it generates a random name for assembly.

My question is, if i create a custom web control under the App_Code
folder, how can i add a register tag on a page.

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo"
Assembly="???????????????" %>

My other question is "Since i don't know the name of the assembly of the
asp.net 2.0 web site, how can dynamically load that assembly using the
Assembly.CreateFromFile () method??

Thank you

Dec 22 '05 #6
<%@ Register Assembly="App_Code" Namespace="A" TagPrefix="abc" %>

This is working perfectly.

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:b8**************************@msnews.microsoft .com...
Use "__code":

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo" Assembly="__code" %>

-Brock
DevelopMentor
http://staff.develop.com/ballen
I know that, in asp.net 2.0, the assembly for the web site is splitted
into pieces and each time you build it, it generates a random name for
assembly.

My question is, if i create a custom web control under the App_Code
folder, how can i add a register tag on a page.

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo"
Assembly="???????????????" %>

My other question is "Since i don't know the name of the assembly of
the asp.net 2.0 web site, how can dynamically load that assembly using
the Assembly.CreateFromFile () method??

Thank you


Dec 22 '05 #7
I found the solution for this.

System.Reflection.Assembly.Load (string assemblyName) solves all of my
problems.

System.Reflection.Assembly.Load ("App_Code") works perfectly.
"Umut Tezduyar" <um**@tezduyar.com> wrote in message
news:eJ*************@TK2MSFTNGP09.phx.gbl...
I know that, in asp.net 2.0, the assembly for the web site is splitted into
pieces and each time you build it, it generates a random name for assembly.

My question is, if i create a custom web control under the App_Code
folder, how can i add a register tag on a page.

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo"
Assembly="???????????????" %>

My other question is "Since i don't know the name of the assembly of the
asp.net 2.0 web site, how can dynamically load that assembly using the
Assembly.CreateFromFile () method??

Thank you

Dec 22 '05 #8
Two underscores in __code.

-Brock
DevelopMentor
http://staff.develop.com/ballen
By the way, it gives an error for _code

<%@ Register Assembly="_code" Namespace="A" TagPrefix="abc" %>

Error 3 Could not load file or assembly '_code' or one of its
dependencies. The system cannot find the file specified. C:\Documents
and Settings\utezduyar\My Documents\Visual Studio
2005\WebSites\WebFrameworkTestSite\Default.aspx 2

"Umut Tezduyar" <um**@tezduyar.com> wrote in message
news:eJ*************@TK2MSFTNGP09.phx.gbl...
I know that, in asp.net 2.0, the assembly for the web site is
splitted into pieces and each time you build it, it generates a
random name for assembly.

My question is, if i create a custom web control under the App_Code
folder, how can i add a register tag on a page.

<%@ Register TagPrefix="ABC" Namespace="ABC.Foo"
Assembly="???????????????" %>

My other question is "Since i don't know the name of the assembly of
the asp.net 2.0 web site, how can dynamically load that assembly
using the Assembly.CreateFromFile () method??

Thank you

Dec 22 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Derrick | last post: by
6 posts views Thread by Philipp Schmid [MSFT] | last post: by
1 post views Thread by tony | last post: by
2 posts views Thread by ahmed.maryam | last post: by
reply views Thread by Sin Jeong-hun | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.