473,396 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to Switch HtmlTextWriter via browserCaps in web.config

Hi,

I want my ASP.NET web application to use a custom HtmlTextWriter. i.e. I
want the object that the Framework passes to System.Web.UI.Control.Render()
to be my own object, MyHtmlTextWriter, which inherits from
System.Web.UI.HtmlTextWriter.

I have tried to do this by changing my application's web.config file: I've
added the following to the /configuration/system.web section.

<browserCaps>
tagwriter=MyNamespace.MyHtmlTextWriter
</browserCaps>

But I now get the following server error.

[ConfigurationException: The HttpBrowserCapabilities string 'tagwriter'
evaluated to 'MyNamespace.MyHtmlTextWriter'. Could not load type
MyNamespace.MyHtmlTextWriter from assembly System.Web, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Check the browserCaps
section of machine.config or web.config to correct the error.]

How can I tell the Framework which assembly it needs to look in to find
MyHtmlTextWriter? And does this assembly have to be in the GAC? - I'd rather
it wasn't.

Thanks,
- Lee

Nov 19 '05 #1
3 2787
Hi Lee,

Welcome to ASPNET newsgroup.
Regarding on problem when overriding the "tagWriter" fo the <browserCaps>
setting, I think it's due to the tagWriter attribute is generally only
provided with a Type Name , no assembly info which cause the runtime
looking for the type in the System.Web.Dll. Based on my test, we can use
the assembly Full Qualified name to specify the tagWriter in <browserCaps>
like:

<browserCaps>

tagWriter=WebTagWriters.DummyWriter,WebTagWriters, Version=1.0.2057.23025,Cul
ture=neutral,PublicKeyToken=2ee82f19289eada7
</browserCaps>

the WebTagWriters.DummyWriter type is in the WebTagWriters.dll assembly.
Also, should strong named the assembly and put it into the GAC.

In addition, based on my research, the currently version of the ASP.NET
(1.x) haven't definite document on customzing the HtmlTextWriter, it is
recommend that we use the buildin ones (HtmlTextWriter or
Html32TextWriter). At lease make sure not to modify the machine.config for
such setting.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
| Thread-Topic: How to Switch HtmlTextWriter via browserCaps in web.config
| thread-index: AcWj8dnR3tm5I45ZT6ucpiHt2R90fw==
| X-WBNR-Posting-Host: 194.200.242.250
| From: "=?Utf-8?B?TGVlIENoYXBtYW4=?=" <Le********@newsgroup.nospam>
| Subject: How to Switch HtmlTextWriter via browserCaps in web.config
| Date: Thu, 18 Aug 2005 05:39:18 -0700
| Lines: 29
| Message-ID: <62**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:118849
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi,
|
| I want my ASP.NET web application to use a custom HtmlTextWriter. i.e. I
| want the object that the Framework passes to
System.Web.UI.Control.Render()
| to be my own object, MyHtmlTextWriter, which inherits from
| System.Web.UI.HtmlTextWriter.
|
| I have tried to do this by changing my application's web.config file:
I've
| added the following to the /configuration/system.web section.
|
| <browserCaps>
| tagwriter=MyNamespace.MyHtmlTextWriter
| </browserCaps>
|
| But I now get the following server error.
|
| [ConfigurationException: The HttpBrowserCapabilities string 'tagwriter'
| evaluated to 'MyNamespace.MyHtmlTextWriter'. Could not load type
| MyNamespace.MyHtmlTextWriter from assembly System.Web,
Version=1.0.5000.0,
| Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Check the browserCaps
| section of machine.config or web.config to correct the error.]
|
| How can I tell the Framework which assembly it needs to look in to find
| MyHtmlTextWriter? And does this assembly have to be in the GAC? - I'd
rather
| it wasn't.
|
| Thanks,
| - Lee
|
|

Nov 19 '05 #2

Thanks - that did it.

(Although I mistyped "neutral" as "netural" in my config file, which stumped
me for a bit... Doh.)

"Steven Cheng[MSFT]" wrote:
Hi Lee,

Welcome to ASPNET newsgroup.
Regarding on problem when overriding the "tagWriter" fo the <browserCaps>
setting, I think it's due to the tagWriter attribute is generally only
provided with a Type Name , no assembly info which cause the runtime
looking for the type in the System.Web.Dll. Based on my test, we can use
the assembly Full Qualified name to specify the tagWriter in <browserCaps>
like:

<browserCaps>

tagWriter=WebTagWriters.DummyWriter,WebTagWriters, Version=1.0.2057.23025,Cul
ture=neutral,PublicKeyToken=2ee82f19289eada7
</browserCaps>

the WebTagWriters.DummyWriter type is in the WebTagWriters.dll assembly.
Also, should strong named the assembly and put it into the GAC.

In addition, based on my research, the currently version of the ASP.NET
(1.x) haven't definite document on customzing the HtmlTextWriter, it is
recommend that we use the buildin ones (HtmlTextWriter or
Html32TextWriter). At lease make sure not to modify the machine.config for
such setting.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
| Thread-Topic: How to Switch HtmlTextWriter via browserCaps in web.config
| thread-index: AcWj8dnR3tm5I45ZT6ucpiHt2R90fw==
| X-WBNR-Posting-Host: 194.200.242.250
| From: "=?Utf-8?B?TGVlIENoYXBtYW4=?=" <Le********@newsgroup.nospam>
| Subject: How to Switch HtmlTextWriter via browserCaps in web.config
| Date: Thu, 18 Aug 2005 05:39:18 -0700
| Lines: 29
| Message-ID: <62**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:118849
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi,
|
| I want my ASP.NET web application to use a custom HtmlTextWriter. i.e. I
| want the object that the Framework passes to
System.Web.UI.Control.Render()
| to be my own object, MyHtmlTextWriter, which inherits from
| System.Web.UI.HtmlTextWriter.
|
| I have tried to do this by changing my application's web.config file:
I've
| added the following to the /configuration/system.web section.
|
| <browserCaps>
| tagwriter=MyNamespace.MyHtmlTextWriter
| </browserCaps>
|
| But I now get the following server error.
|
| [ConfigurationException: The HttpBrowserCapabilities string 'tagwriter'
| evaluated to 'MyNamespace.MyHtmlTextWriter'. Could not load type
| MyNamespace.MyHtmlTextWriter from assembly System.Web,
Version=1.0.5000.0,
| Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Check the browserCaps
| section of machine.config or web.config to correct the error.]
|
| How can I tell the Framework which assembly it needs to look in to find
| MyHtmlTextWriter? And does this assembly have to be in the GAC? - I'd
rather
| it wasn't.
|
| Thanks,
| - Lee
|
|

Nov 19 '05 #3
You're welcome Lee,

Thanks again for your posting.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: How to Switch HtmlTextWriter via browserCaps in web.config
| thread-index: AcWn6rdx87ybMs6vS2C2/8z1U7d9WQ==
| X-WBNR-Posting-Host: 194.200.242.250
| From: "=?Utf-8?B?TGVlIENoYXBtYW4=?=" <Le********@newsgroup.nospam>
| References: <62**********************************@microsoft.co m>
<j4**************@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: How to Switch HtmlTextWriter via browserCaps in web.config
| Date: Tue, 23 Aug 2005 06:58:19 -0700
| Lines: 112
| Message-ID: <2D**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:119721
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
|
| Thanks - that did it.
|
| (Although I mistyped "neutral" as "netural" in my config file, which
stumped
| me for a bit... Doh.)
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Lee,
| >
| > Welcome to ASPNET newsgroup.
| > Regarding on problem when overriding the "tagWriter" fo the
<browserCaps>
| > setting, I think it's due to the tagWriter attribute is generally only
| > provided with a Type Name , no assembly info which cause the runtime
| > looking for the type in the System.Web.Dll. Based on my test, we can
use
| > the assembly Full Qualified name to specify the tagWriter in
<browserCaps>
| > like:
| >
| > <browserCaps>
| >
| >
tagWriter=WebTagWriters.DummyWriter,WebTagWriters, Version=1.0.2057.23025,Cul
| > ture=neutral,PublicKeyToken=2ee82f19289eada7
| > </browserCaps>
| >
| > the WebTagWriters.DummyWriter type is in the WebTagWriters.dll
assembly.
| > Also, should strong named the assembly and put it into the GAC.
| >
| > In addition, based on my research, the currently version of the ASP.NET
| > (1.x) haven't definite document on customzing the HtmlTextWriter, it is
| > recommend that we use the buildin ones (HtmlTextWriter or
| > Html32TextWriter). At lease make sure not to modify the machine.config
for
| > such setting.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| >
| >
| >
| >
| >
| >
| > --------------------
| > | Thread-Topic: How to Switch HtmlTextWriter via browserCaps in
web.config
| > | thread-index: AcWj8dnR3tm5I45ZT6ucpiHt2R90fw==
| > | X-WBNR-Posting-Host: 194.200.242.250
| > | From: "=?Utf-8?B?TGVlIENoYXBtYW4=?=" <Le********@newsgroup.nospam>
| > | Subject: How to Switch HtmlTextWriter via browserCaps in web.config
| > | Date: Thu, 18 Aug 2005 05:39:18 -0700
| > | Lines: 29
| > | Message-ID: <62**********************************@microsoft.co m>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:118849
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Hi,
| > |
| > | I want my ASP.NET web application to use a custom HtmlTextWriter.
i.e. I
| > | want the object that the Framework passes to
| > System.Web.UI.Control.Render()
| > | to be my own object, MyHtmlTextWriter, which inherits from
| > | System.Web.UI.HtmlTextWriter.
| > |
| > | I have tried to do this by changing my application's web.config file:
| > I've
| > | added the following to the /configuration/system.web section.
| > |
| > | <browserCaps>
| > | tagwriter=MyNamespace.MyHtmlTextWriter
| > | </browserCaps>
| > |
| > | But I now get the following server error.
| > |
| > | [ConfigurationException: The HttpBrowserCapabilities string
'tagwriter'
| > | evaluated to 'MyNamespace.MyHtmlTextWriter'. Could not load type
| > | MyNamespace.MyHtmlTextWriter from assembly System.Web,
| > Version=1.0.5000.0,
| > | Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Check the
browserCaps
| > | section of machine.config or web.config to correct the error.]
| > |
| > | How can I tell the Framework which assembly it needs to look in to
find
| > | MyHtmlTextWriter? And does this assembly have to be in the GAC? - I'd
| > rather
| > | it wasn't.
| > |
| > | Thanks,
| > | - Lee
| > |
| > |
| >
| >
|

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Jason Collins | last post by:
There are some Requests that occur that have a NULL UserAgent. Some of these are legitimate crawlers (e.g., Overture's crawler), and I'm attempting to adjust my <browserCaps> to correctly classify...
0
by: Earl Teigrob | last post by:
I am looking for updated code for the browsercaps section of machine.config(or webconfig) that that adds support for non-microsoft browsers. I have read about http://www.cyscape.com/browsercaps/...
1
by: Andy Emmerson via .NET 247 | last post by:
Hi I am looking to write a custom section handler so that I can populate the MobileCapabilities object from my our custom data rather than the browserCaps section in machine.config. From my...
6
by: Eric | last post by:
Hi, Why there is no <browserCaps> section, which is correct? I understand that Netscape and others are 'DownLevel' browser, but in my case, also the PocketIE on my Ipaq and Opera browser for...
10
by: Eric | last post by:
Hi, Why there is no <browserCaps> section, which is correct? I understand that Netscape and others are 'DownLevel' browser, but in my case, also the PocketIE on my Ipaq and Opera browser for...
6
by: Jim_tvm | last post by:
I'm very new to web development using ASP.NET. I'm developing a site using ASP.NET. My site looks fine if you use IE but if you open it in NS it's not displaying properly. And this display will...
0
by: sujan | last post by:
Hi all, I'm very new to web development using ASP.NET. I'm developing a site using ASP.NET. My site looks fine if you use IE but if you open it in NS it's not displaying properly. And this...
1
by: Davidhere40 | last post by:
I'm using a visual studio generated proxy to use the web services, but I can't seem to get it to switch from using a local version to the actual web based web service. It always always always uses...
5
by: =?Utf-8?B?RGFuaWVs?= | last post by:
How can I switch connection strings stored in config file based on the build configuration? Or my real question is how most people maintain different connection strings when their code is running...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.