difference between assembly in aspx page and web.config?

B

Beemer Biker

I have some demo code that came with a 3rd party product. This is what it
looks like (I remove html braces in case it does not print right)

Register TagPrefix="pin" Namespace="Pintexx.Components.Web.pinTab"
Assembly="pinTab"

That line of code was the 2nd line just below the Page Language="C#" ... in
default.aspx

I created a new, blank page, and attempted to copy and paste the control
onto the new page. Got an error message that the control was not registered
as follows: "This control cannot be displayed because its TagPrefix is not
registered in this Web Form."
OK, I assume I can easily fix that by copying that registration line to the
new page.

Was wondering why I got to do this in the first place? I noticed that my
web.config file has some assemblies such as:

<assemblies>
<add assembly="System.Windows.Forms, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=xxx"/>
<add assembly="System.Security, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=xxx"/>
<add assembly="Accessibility, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=xxx"/>
<add assembly="System.Runtime.Serialization.Formatters.Soap,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=xxx"/>
<add assembly="System.Deployment, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=xxx"/>
</assemblies>

Can I put that pintab registration into web.config and avoid using that
registration code snippet altogether?
So what is the difference between an Assmbly in the aspx page and an
assembly in web.config?

The 3rd party control did not come with an install and it is not in the
toolbox for VS2005.


--
======================================================================
Joseph "Beemer Biker" Stateson
http://TipsForTheComputingImpaired.com
http://ResearchRiders.org Ask about my 99'R1100RT
======================================================================
 
B

bruce barker

the <assemblies> adds dll's for compiling, usually ones not in the bin.
tagPrefix is used to define a prefix to identify 3rd party controls.
it can be specied in the web.config under system.web/pages/controls
instead of each page.

<controls>
<add tagPrefix="pin"
Namespace="Pintexx.Components.Web.pinTab" Assembly="pinTab" />
</controls>

-- bruce (sqlwork.com)
 
B

Beemer Biker

bruce barker said:
the <assemblies> adds dll's for compiling, usually ones not in the bin.
tagPrefix is used to define a prefix to identify 3rd party controls. it
can be specied in the web.config under system.web/pages/controls instead
of each page.

<controls>
<add tagPrefix="pin"
Namespace="Pintexx.Components.Web.pinTab" Assembly="pinTab" />
</controls>

Thanks Bruce! That worked.
I was able to remove all pintab registration from my C# files after I added
the following to web.config:

<pages>
<controls>
<add tagPrefix="pin" namespace="Pintexx.Components.Web.pinTab"
assembly="pinTab" />
</controls>
</pages>
<compilation debug="true">
<assemblies>
<add assembly="pinTab, Version=2.0.60130.0, Culture=neutral,
PublicKeyToken=xxx"/>
</assemblies>
</compilation>

So why do I have to add these? Should not the vendor have built the sofware
so that a drop from the VS2005 toolkit puts the correct assembly info in the
web.config? It did not come with a toolkit component, only source code
with those registration statements. I am just guesing about how that could
be done from a toolkit.

I would not have known to put that stuff there. A build did generate the
publickeytoken (that object of tha that assembly statement above) from their
original .aspx sample code, else I would not know the publickeytoken nor
version.

While I no longer need to have those prefix registration, I am still having
this problem that I posted earlier:
Re-sizing that pintab control
replaces "pin:Tab" with "Pintexx.Components.Web.pinTab" which does not
compile as valid xhtml1.0 code. and I have to code pin:Tab tabprefix back
in.


--
======================================================================
Joseph "Beemer Biker" Stateson
http://TipsForTheComputingImpaired.com
http://ResearchRiders.org Ask about my 99'R1100RT
======================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top