Showing posts with label controls. Show all posts
Showing posts with label controls. Show all posts

Saturday, March 24, 2012

Strong Naming an ASP.Net Project

Hello,

I have a Web Project (UserControls.dll) with some user controls that
is shared by many asp.net web applicattions.

What we do is copy UserControls.dll to all the applications bin
folders an this works correctly.

We want to have this shared code in the GAC.

Wit other non-web projects we create a snk file, add it to the project
and compile. Later we register this dll manually in the GAC.

I have been trying to do this with a web project , and all the time I
get an error saying that it cannot read the snk file.

Is it possible to strong name the generated dll of a web project?

Thanks in Advance.

ManuelYes it is, but with ASP.NET there are two places where a binary is built.
You may have to put the strong name in the temporary directory where things
are built:

c:\documents and
settings\<userName>\VSWebCache\<machineName>\<applicationName
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Manuel Lopez" <mcpollo@.terra.es> wrote in message
news:cd080612.0312010830.45b95557@.posting.google.c om...
> Hello,
> I have a Web Project (UserControls.dll) with some user controls that
> is shared by many asp.net web applicattions.
> What we do is copy UserControls.dll to all the applications bin
> folders an this works correctly.
> We want to have this shared code in the GAC.
> Wit other non-web projects we create a snk file, add it to the project
> and compile. Later we register this dll manually in the GAC.
> I have been trying to do this with a web project , and all the time I
> get an error saying that it cannot read the snk file.
> Is it possible to strong name the generated dll of a web project?
> Thanks in Advance.
> Manuel
Hello Chris,

Thanks for the reply.

Our problem is that we cannot compile our web project with
the user controls when we add a snk file and reference it
from Assembly file.

It seems as if you cannot use then with web projects.

>--Original Message--
>Yes it is, but with ASP.NET there are two places where a
binary is built.
>You may have to put the strong name in the temporary
directory where things
>are built:
>c:\documents and
>settings\<userName>\VSWebCache\<machineName>\<applicationN
ame>
>
>--
>Chris Jackson
>Software Engineer
>Microsoft MVP - Windows Client
>Windows XP Associate Expert
>--
>More people read the newsgroups than read my email.
>Reply to the newsgroup for a faster response.
>(Control-G using Outlook Express)
>--
>"Manuel Lopez" <mcpollo@.terra.es> wrote in message
>news:cd080612.0312010830.45b95557@.posting.google.c om...
>> Hello,
>>
>> I have a Web Project (UserControls.dll) with some user
controls that
>> is shared by many asp.net web applicattions.
>>
>> What we do is copy UserControls.dll to all the
applications bin
>> folders an this works correctly.
>>
>> We want to have this shared code in the GAC.
>>
>> Wit other non-web projects we create a snk file, add it
to the project
>> and compile. Later we register this dll manually in the
GAC.
>>
>> I have been trying to do this with a web project , and
all the time I
>> get an error saying that it cannot read the snk file.
>>
>> Is it possible to strong name the generated dll of a
web project?
>>
>> Thanks in Advance.
>>
>> Manuel
>
>.
I may be missing what you are asking here. Are you trying to compile the
project you are strong naming and failing? If that is the case, then you
need to move the SNK file. The error that is generated should tell you the
directory it is searching in and failing to find it. Have you compiled and
strong named an assembly, and having trouble referencing it? You should
definitely be able to reference a strong named file - that also works. You
just need to make sure it is in the search path. What is the error that you
are seeing?

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Manuel Lopez" <anonymous@.discussions.microsoft.com> wrote in message
news:0ae201c3b833$8a338160$a501280a@.phx.gbl...
> Hello Chris,
> Thanks for the reply.
> Our problem is that we cannot compile our web project with
> the user controls when we add a snk file and reference it
> from Assembly file.
> It seems as if you cannot use then with web projects.
>
> >--Original Message--
> >Yes it is, but with ASP.NET there are two places where a
> binary is built.
> >You may have to put the strong name in the temporary
> directory where things
> >are built:
> >c:\documents and
> >settings\<userName>\VSWebCache\<machineName>\<applicationN
> ame>
> >--
> >Chris Jackson
> >Software Engineer
> >Microsoft MVP - Windows Client
> >Windows XP Associate Expert
> >--
> >More people read the newsgroups than read my email.
> >Reply to the newsgroup for a faster response.
> >(Control-G using Outlook Express)
> >--
> >"Manuel Lopez" <mcpollo@.terra.es> wrote in message
> >news:cd080612.0312010830.45b95557@.posting.google.c om...
> >> Hello,
> >>
> >> I have a Web Project (UserControls.dll) with some user
> controls that
> >> is shared by many asp.net web applicattions.
> >>
> >> What we do is copy UserControls.dll to all the
> applications bin
> >> folders an this works correctly.
> >>
> >> We want to have this shared code in the GAC.
> >>
> >> Wit other non-web projects we create a snk file, add it
> to the project
> >> and compile. Later we register this dll manually in the
> GAC.
> >>
> >> I have been trying to do this with a web project , and
> all the time I
> >> get an error saying that it cannot read the snk file.
> >>
> >> Is it possible to strong name the generated dll of a
> web project?
> >>
> >> Thanks in Advance.
> >>
> >> Manuel
> >.
Hello Again Chris,

My problem is that i cant generate the strong name "web"
project.

The snk file is the at the same level of of vbproj file,
and in assembly i have :

<Assembly: AssemblyKeyFile("..\..\Keys.snk")>

I have tried copying the snk file to the bin directory,
changing the path and it just doesnt work for a "Web"
project.

Maybe you just cant strong name a "Web" through Visual
Studio.

Thanks

>--Original Message--
>I may be missing what you are asking here. Are you trying
to compile the
>project you are strong naming and failing? If that is the
case, then you
>need to move the SNK file. The error that is generated
should tell you the
>directory it is searching in and failing to find it. Have
you compiled and
>strong named an assembly, and having trouble referencing
it? You should
>definitely be able to reference a strong named file -
that also works. You
>just need to make sure it is in the search path. What is
the error that you
>are seeing?
>--
>Chris Jackson
>Software Engineer
>Microsoft MVP - Windows Client
>Windows XP Associate Expert
>--
>More people read the newsgroups than read my email.
>Reply to the newsgroup for a faster response.
>(Control-G using Outlook Express)
>--
>"Manuel Lopez" <anonymous@.discussions.microsoft.com>
wrote in message
>news:0ae201c3b833$8a338160$a501280a@.phx.gbl...
>> Hello Chris,
>>
>> Thanks for the reply.
>>
>> Our problem is that we cannot compile our web project
with
>> the user controls when we add a snk file and reference
it
>> from Assembly file.
>>
>> It seems as if you cannot use then with web projects.
>>
>>
>> >--Original Message--
>> >Yes it is, but with ASP.NET there are two places where
a
>> binary is built.
>> >You may have to put the strong name in the temporary
>> directory where things
>> >are built:
>>> >c:\documents and
>>
>settings\<userName>\VSWebCache\<machineName>\<applicationN
>> ame>
>>>> >--
>> >Chris Jackson
>> >Software Engineer
>> >Microsoft MVP - Windows Client
>> >Windows XP Associate Expert
>> >--
>> >More people read the newsgroups than read my email.
>> >Reply to the newsgroup for a faster response.
>> >(Control-G using Outlook Express)
>> >--
>>> >"Manuel Lopez" <mcpollo@.terra.es> wrote in message
>> >news:cd080612.0312010830.45b95557@.posting.google.c om...
>> >> Hello,
>> >>
>> >> I have a Web Project (UserControls.dll) with some
user
>> controls that
>> >> is shared by many asp.net web applicattions.
>> >>
>> >> What we do is copy UserControls.dll to all the
>> applications bin
>> >> folders an this works correctly.
>> >>
>> >> We want to have this shared code in the GAC.
>> >>
>> >> Wit other non-web projects we create a snk file, add
it
>> to the project
>> >> and compile. Later we register this dll manually in
the
>> GAC.
>> >>
>> >> I have been trying to do this with a web project ,
and
>> all the time I
>> >> get an error saying that it cannot read the snk file.
>> >>
>> >> Is it possible to strong name the generated dll of a
>> web project?
>> >>
>> >> Thanks in Advance.
>> >>
>> >> Manuel
>>>> >.
>>
>.
You can strong name it, you just have to manually drag the SNK file to the
VSWebCache folder (as indicated in my first post). VS.NET does not provide
the mechanisms, though the error message should help you locate the proper
directory. The folder in inetpub is NOT where it goes. I have done it
before, I just don't have any on this machine to give you the exact
location, but I promise you that it works.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Manuel Lopez" <anonymous@.discussions.microsoft.com> wrote in message
news:afa901c3b8b6$b56a0a10$a601280a@.phx.gbl...
Hello Again Chris,

My problem is that i cant generate the strong name "web"
project.

The snk file is the at the same level of of vbproj file,
and in assembly i have :

<Assembly: AssemblyKeyFile("..\..\Keys.snk")
I have tried copying the snk file to the bin directory,
changing the path and it just doesnt work for a "Web"
project.

Maybe you just cant strong name a "Web" through Visual
Studio.

Thanks

>--Original Message--
>I may be missing what you are asking here. Are you trying
to compile the
>project you are strong naming and failing? If that is the
case, then you
>need to move the SNK file. The error that is generated
should tell you the
>directory it is searching in and failing to find it. Have
you compiled and
>strong named an assembly, and having trouble referencing
it? You should
>definitely be able to reference a strong named file -
that also works. You
>just need to make sure it is in the search path. What is
the error that you
>are seeing?
>--
>Chris Jackson
>Software Engineer
>Microsoft MVP - Windows Client
>Windows XP Associate Expert
>--
>More people read the newsgroups than read my email.
>Reply to the newsgroup for a faster response.
>(Control-G using Outlook Express)
>--
>"Manuel Lopez" <anonymous@.discussions.microsoft.com>
wrote in message
>news:0ae201c3b833$8a338160$a501280a@.phx.gbl...
>> Hello Chris,
>>
>> Thanks for the reply.
>>
>> Our problem is that we cannot compile our web project
with
>> the user controls when we add a snk file and reference
it
>> from Assembly file.
>>
>> It seems as if you cannot use then with web projects.
>>
>>
>> >--Original Message--
>> >Yes it is, but with ASP.NET there are two places where
a
>> binary is built.
>> >You may have to put the strong name in the temporary
>> directory where things
>> >are built:
>>> >c:\documents and
>>
>settings\<userName>\VSWebCache\<machineName>\<applicationN
>> ame>
>>>> >--
>> >Chris Jackson
>> >Software Engineer
>> >Microsoft MVP - Windows Client
>> >Windows XP Associate Expert
>> >--
>> >More people read the newsgroups than read my email.
>> >Reply to the newsgroup for a faster response.
>> >(Control-G using Outlook Express)
>> >--
>>> >"Manuel Lopez" <mcpollo@.terra.es> wrote in message
>> >news:cd080612.0312010830.45b95557@.posting.google.c om...
>> >> Hello,
>> >>
>> >> I have a Web Project (UserControls.dll) with some
user
>> controls that
>> >> is shared by many asp.net web applicattions.
>> >>
>> >> What we do is copy UserControls.dll to all the
>> applications bin
>> >> folders an this works correctly.
>> >>
>> >> We want to have this shared code in the GAC.
>> >>
>> >> Wit other non-web projects we create a snk file, add
it
>> to the project
>> >> and compile. Later we register this dll manually in
the
>> GAC.
>> >>
>> >> I have been trying to do this with a web project ,
and
>> all the time I
>> >> get an error saying that it cannot read the snk file.
>> >>
>> >> Is it possible to strong name the generated dll of a
>> web project?
>> >>
>> >> Thanks in Advance.
>> >>
>> >> Manuel
>>>> >.
>>
>.
I guess I should point out, for the sake of completeness, that this may not
be the best idea. The reason I have strong named ASP.NET assemblies is
basically just to see if it can be done. (Well, FXCop was barking...)
However, note that the model for ASP.NET is not *complete* compilation, but
rather compilation of the code behind, followed by JIT compilation of the
declarative ASPX page. So, your derived forms won't actually exist in the
strong named assembly. What you should consider is developing a class
library of classes that derive from the UserControl class to provide the
basic functionality that you need, and then provide declarative pages whose
code behind inherits from this. This just occurred to me, so I figured I
would add this appendix...

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:%23RN%23aIPuDHA.3256@.TK2MSFTNGP11.phx.gbl...
> You can strong name it, you just have to manually drag the SNK file to the
> VSWebCache folder (as indicated in my first post). VS.NET does not provide
> the mechanisms, though the error message should help you locate the proper
> directory. The folder in inetpub is NOT where it goes. I have done it
> before, I just don't have any on this machine to give you the exact
> location, but I promise you that it works.
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows Client
> Windows XP Associate Expert
> --
> More people read the newsgroups than read my email.
> Reply to the newsgroup for a faster response.
> (Control-G using Outlook Express)
> --
> "Manuel Lopez" <anonymous@.discussions.microsoft.com> wrote in message
> news:afa901c3b8b6$b56a0a10$a601280a@.phx.gbl...
> Hello Again Chris,
> My problem is that i cant generate the strong name "web"
> project.
> The snk file is the at the same level of of vbproj file,
> and in assembly i have :
> <Assembly: AssemblyKeyFile("..\..\Keys.snk")>
> I have tried copying the snk file to the bin directory,
> changing the path and it just doesnt work for a "Web"
> project.
> Maybe you just cant strong name a "Web" through Visual
> Studio.
> Thanks
> >--Original Message--
> >I may be missing what you are asking here. Are you trying
> to compile the
> >project you are strong naming and failing? If that is the
> case, then you
> >need to move the SNK file. The error that is generated
> should tell you the
> >directory it is searching in and failing to find it. Have
> you compiled and
> >strong named an assembly, and having trouble referencing
> it? You should
> >definitely be able to reference a strong named file -
> that also works. You
> >just need to make sure it is in the search path. What is
> the error that you
> >are seeing?
> >--
> >Chris Jackson
> >Software Engineer
> >Microsoft MVP - Windows Client
> >Windows XP Associate Expert
> >--
> >More people read the newsgroups than read my email.
> >Reply to the newsgroup for a faster response.
> >(Control-G using Outlook Express)
> >--
> >"Manuel Lopez" <anonymous@.discussions.microsoft.com>
> wrote in message
> >news:0ae201c3b833$8a338160$a501280a@.phx.gbl...
> >> Hello Chris,
> >>
> >> Thanks for the reply.
> >>
> >> Our problem is that we cannot compile our web project
> with
> >> the user controls when we add a snk file and reference
> it
> >> from Assembly file.
> >>
> >> It seems as if you cannot use then with web projects.
> >>
> >>
> >> >--Original Message--
> >> >Yes it is, but with ASP.NET there are two places where
> a
> >> binary is built.
> >> >You may have to put the strong name in the temporary
> >> directory where things
> >> >are built:
> >> >> >c:\documents and
> >>
> >settings\<userName>\VSWebCache\<machineName>\<applicationN
> >> ame>
> >> >> >> >--
> >> >Chris Jackson
> >> >Software Engineer
> >> >Microsoft MVP - Windows Client
> >> >Windows XP Associate Expert
> >> >--
> >> >More people read the newsgroups than read my email.
> >> >Reply to the newsgroup for a faster response.
> >> >(Control-G using Outlook Express)
> >> >--
> >> >> >"Manuel Lopez" <mcpollo@.terra.es> wrote in message
> >> >news:cd080612.0312010830.45b95557@.posting.google.c om...
> >> >> Hello,
> >> >>
> >> >> I have a Web Project (UserControls.dll) with some
> user
> >> controls that
> >> >> is shared by many asp.net web applicattions.
> >> >>
> >> >> What we do is copy UserControls.dll to all the
> >> applications bin
> >> >> folders an this works correctly.
> >> >>
> >> >> We want to have this shared code in the GAC.
> >> >>
> >> >> Wit other non-web projects we create a snk file, add
> it
> >> to the project
> >> >> and compile. Later we register this dll manually in
> the
> >> GAC.
> >> >>
> >> >> I have been trying to do this with a web project ,
> and
> >> all the time I
> >> >> get an error saying that it cannot read the snk file.
> >> >>
> >> >> Is it possible to strong name the generated dll of a
> >> web project?
> >> >>
> >> >> Thanks in Advance.
> >> >>
> >> >> Manuel
> >> >> >> >.
> >> >.

Thursday, March 22, 2012

Strong typing for user controls

I'm a lot confused when using user controls in ASP.NET 2.0. How do I cast a
varaible to the type of a user control... for example:

Me.PlaceHolder1.Controls.Add(Page.LoadControl("~/App_Controls/ctlApplicationHome.ascx"))

' now, this doesn't work... why?
Dim apl As App_Controls_ctlApplicationHome = Me.PlaceHolder1.Controls(0);Ryan wrote:
> I'm a lot confused when using user controls in ASP.NET 2.0. How do I cast a
> varaible to the type of a user control... for example:
> Me.PlaceHolder1.Controls.Add(Page.LoadControl("~/App_Controls/ctlApplicationHome.ascx"))
> ' now, this doesn't work... why?
> Dim apl As App_Controls_ctlApplicationHome = Me.PlaceHolder1.Controls(0);

Dim apl As App_Controls_ctlApplicationHome =
CType(Me.PlaceHolder1.Controls(0), App_Controls_ctlApplicationHome)

That should do it.

Just curious, what .NET language are you using? It looks like VB but I
notice you have a semi-colon at the very end of your last line of code.
:)
Actually, let me clarify... the class "App_Controls_ctlApplicationHome" does
not exist... where is it!?!

"Ryan" wrote:

> I'm a lot confused when using user controls in ASP.NET 2.0. How do I cast a
> varaible to the type of a user control... for example:
> Me.PlaceHolder1.Controls.Add(Page.LoadControl("~/App_Controls/ctlApplicationHome.ascx"))
> ' now, this doesn't work... why?
> Dim apl As App_Controls_ctlApplicationHome = Me.PlaceHolder1.Controls(0);
>
Actually, here's a revised description of the issue:

I have two user controls, each of which sits in a directory called
"App_Controls" in an ASP.NET 2.0 site. When I try dynamically loading Control
#2 to a placeholder in Control #1, I cannot get a strongly typed reference to
that control, because the Type "App_Controls_ctlApplicationHome" is not
defined.

Does that make sense?

(to answer your question, I'm a C# developer working on a VB.NET project,
hence the schizophrenic coding)

"tdavisjr" wrote:

> Ryan wrote:
> > I'm a lot confused when using user controls in ASP.NET 2.0. How do I cast a
> > varaible to the type of a user control... for example:
> > Me.PlaceHolder1.Controls.Add(Page.LoadControl("~/App_Controls/ctlApplicationHome.ascx"))
> > ' now, this doesn't work... why?
> > Dim apl As App_Controls_ctlApplicationHome = Me.PlaceHolder1.Controls(0);
> Dim apl As App_Controls_ctlApplicationHome =
> CType(Me.PlaceHolder1.Controls(0), App_Controls_ctlApplicationHome)
> That should do it.
> Just curious, what .NET language are you using? It looks like VB but I
> notice you have a semi-colon at the very end of your last line of code.
> :)
>
On Fri, 13 Jan 2006 09:34:02 -0800, "Ryan"
<Ryan@.discussions.microsoft.com> wrote:

>I have two user controls, each of which sits in a directory called
>"App_Controls" in an ASP.NET 2.0 site. When I try dynamically loading Control
>#2 to a placeholder in Control #1, I cannot get a strongly typed reference to
>that control, because the Type "App_Controls_ctlApplicationHome" is not
>defined.

You need an @. Reference in your aspx page to the user control.

<%@. Reference VirtualPath="~/Products.ascx" %
That will make sure the user control type is visible in your code
file.

Example:
http://odetocode.com/Blogs/scott/ar...06/30/1889.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/
Ah, of course! Thanks!

"Scott Allen" wrote:

> On Fri, 13 Jan 2006 09:34:02 -0800, "Ryan"
> <Ryan@.discussions.microsoft.com> wrote:
> >I have two user controls, each of which sits in a directory called
> >"App_Controls" in an ASP.NET 2.0 site. When I try dynamically loading Control
> >#2 to a placeholder in Control #1, I cannot get a strongly typed reference to
> >that control, because the Type "App_Controls_ctlApplicationHome" is not
> >defined.
> You need an @. Reference in your aspx page to the user control.
> <%@. Reference VirtualPath="~/Products.ascx" %>
> That will make sure the user control type is visible in your code
> file.
> Example:
> http://odetocode.com/Blogs/scott/ar...06/30/1889.aspx
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/

Strong typing for user controls

I'm a lot when using user controls in ASP.NET 2.0. How do I cast a
varaible to the type of a user control... for example:
Me.PlaceHolder1.Controls.Add(Page.LoadControl("~/App_Controls/ctlApplication
Home.ascx"))
' now, this doesn't work... why?
Dim apl As App_Controls_ctlApplicationHome = Me.PlaceHolder1.Controls(0);Ryan wrote:
> I'm a lot when using user controls in ASP.NET 2.0. How do I cast
a
> varaible to the type of a user control... for example:
> Me.PlaceHolder1.Controls.Add(Page.LoadControl("~/App_Controls/ctlApplicati
onHome.ascx"))
> ' now, this doesn't work... why?
> Dim apl As App_Controls_ctlApplicationHome = Me.PlaceHolder1.Controls(0);
Dim apl As App_Controls_ctlApplicationHome =
CType(Me.PlaceHolder1.Controls(0), App_Controls_ctlApplicationHome)
That should do it.
Just curious, what .NET language are you using? It looks like VB but I
notice you have a semi-colon at the very end of your last line of code.
:)
Actually, let me clarify... the class "App_Controls_ctlApplicationHome" does
not exist... where is it!?!
"Ryan" wrote:

> I'm a lot when using user controls in ASP.NET 2.0. How do I cast
a
> varaible to the type of a user control... for example:
> Me.PlaceHolder1.Controls.Add(Page.LoadControl("~/App_Controls/ctlApplicati
onHome.ascx"))
> ' now, this doesn't work... why?
> Dim apl As App_Controls_ctlApplicationHome = Me.PlaceHolder1.Controls(0);
>
Actually, here's a revised description of the issue:
I have two user controls, each of which sits in a directory called
"App_Controls" in an ASP.NET 2.0 site. When I try dynamically loading Contro
l
#2 to a placeholder in Control #1, I cannot get a strongly typed reference t
o
that control, because the Type "App_Controls_ctlApplicationHome" is not
defined.
Does that make sense?
(to answer your question, I'm a C# developer working on a VB.NET project,
hence the schizophrenic coding)
"tdavisjr" wrote:

> Ryan wrote:
> Dim apl As App_Controls_ctlApplicationHome =
> CType(Me.PlaceHolder1.Controls(0), App_Controls_ctlApplicationHome)
> That should do it.
> Just curious, what .NET language are you using? It looks like VB but I
> notice you have a semi-colon at the very end of your last line of code.
> :)
>
On Fri, 13 Jan 2006 09:34:02 -0800, "Ryan"
<Ryan@.discussions.microsoft.com> wrote:

>I have two user controls, each of which sits in a directory called
>"App_Controls" in an ASP.NET 2.0 site. When I try dynamically loading Contr
ol
>#2 to a placeholder in Control #1, I cannot get a strongly typed reference
to
>that control, because the Type "App_Controls_ctlApplicationHome" is not
>defined.
>
You need an @. Reference in your aspx page to the user control.
<%@. Reference VirtualPath="~/Products.ascx" %>
That will make sure the user control type is visible in your code
file.
Example:
http://odetocode.com/Blogs/scott/ar...06/30/1889.aspx
Scott
http://www.OdeToCode.com/blogs/scott/
Ah, of course! Thanks!
"Scott Allen" wrote:

> On Fri, 13 Jan 2006 09:34:02 -0800, "Ryan"
> <Ryan@.discussions.microsoft.com> wrote:
>
> You need an @. Reference in your aspx page to the user control.
> <%@. Reference VirtualPath="~/Products.ascx" %>
> That will make sure the user control type is visible in your code
> file.
> Example:
> http://odetocode.com/Blogs/scott/ar...06/30/1889.aspx
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
>

Tuesday, March 13, 2012

stuck in the beginning!

Hi!
I tried to create my first ASP .NET application using VBScript, i recenetly installed .NET, i added some controls like a textbox, a button and few labels. When i try to view the web page, only the labels can be seen but not any other controls. When i try to debug it, i get a messadge saying that i need to install some components. Cany anyone help me out? Thank you.First of all, ASP.NET uses VB.NET not VBScript but I assume that it was just a typo on your behalf (confusing ASP and ASP.NET). In order to get it to work you'll need to install ASP.NET on your IIS server, as follows:
1. go to the command prompt (Start, Run, cmd.exe)
2. go to the Windows\Microsoft.NET\Framework\v1.1.4322 folder
3. execute aspnet_regiis.exe /i

In order to do this, make sure the .NET Framework is installed on the system (available through Windows Update or via the MSDN website). I assume you're using IIS to develop ASP.NET apps in this case. To view your pages, save them in the inetpub\wwwroot folder and go to http://localhost/thepage.aspx (replace theplace.aspx of course) to view the result.
Thanks a lot man. This will get me going. And i apologize for the typo. Thanks again.

Stuck on XML/XSLT with Asp.net 1.1 server controls.

Hello everyone,

I am working on a custom built portal system in Visual Studio 2003 and I amstuck on how to develop with XML/XSLT and using Asp.net server controls. Theportal consists of "applications" (each application is essentially a.aspx page) and those applications consists of "modules" (whichderives from UserControl). Now in order to maintain a consistent look for allmodules/applications and to minimize the amount of actual html hard coded, Iwant to use XSLT (which would contain the html) and CSS to help generate thatconsistent appearance. TheModule class containstitle andbodyfields, wherebodycan have any form of content (html/text/javascript),but sinceModulederives from UserControl, it can also contain .Net childcontrols, and I need those child controls to render correctly to take fulladvantage of Asp.Net. What would be the best approach to accomplish this inwhich the module would be transformed using a XSL file?


This also needs to apply to an application as well (or atleast the layout of the application, something that controls the placement ofthe modules). If I have a collection of modules, I need to put them in someform of structure or layout and transform that layout through an XSL file tohave a consistent look and only one place to look when we need to change thelook of a module or application. What would be the best approach for this orcould you point me in the right direction? If you need any furtherclarification, I would be more than willing to help. Thanks in advance!

Steve

Wow that was a lot...

Was there a specific bit of coding that you are stuck on or are you looking for a broadranged theory?


If you'd like I can tell you what I have right now, but I'mthinking it may be better to take a step back and look at it from a differentangle.Smile [:)] The first question is best approach to take a user control that contains child controls and other content, run it through an .xsl file, and have it display properly on the page. Thanks for your help!


User controls containing child controls is nothing special... in fact really just about every User Control ever made has child controls. User Controls, with User Controls would be nothing different really either...

Let me see if I have it right, before I comment...

You want your XML to contain the list of what's on each control, and the XSL to contain the "way" that the controls display? Is that correct?

And you are wondering if this is a good approach?