473,581 Members | 2,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.C ontrol.Render()
to be my own object, MyHtmlTextWrite r, which inherits from
System.Web.UI.H tmlTextWriter.

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=MyNam espace.MyHtmlTe xtWriter
</browserCaps>

But I now get the following server error.

[ConfigurationEx ception: The HttpBrowserCapa bilities string 'tagwriter'
evaluated to 'MyNamespace.My HtmlTextWriter' . Could not load type
MyNamespace.MyH tmlTextWriter from assembly System.Web, Version=1.0.500 0.0,
Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a. 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
MyHtmlTextWrite r? And does this assembly have to be in the GAC? - I'd rather
it wasn't.

Thanks,
- Lee

Nov 19 '05 #1
3 2804
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=WebTa gWriters.DummyW riter,WebTagWri ters,Version=1. 0.2057.23025,Cu l
ture=neutral,Pu blicKeyToken=2e e82f19289eada7
</browserCaps>

the WebTagWriters.D ummyWriter type is in the WebTagWriters.d ll 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
Html32TextWrite r). 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: AcWj8dnR3tm5I45 ZT6ucpiHt2R90fw ==
| X-WBNR-Posting-Host: 194.200.242.250
| From: "=?Utf-8?B?TGVlIENoYXB tYW4=?=" <Le********@new sgroup.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************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA02.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1188 49
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.C ontrol.Render()
| to be my own object, MyHtmlTextWrite r, which inherits from
| System.Web.UI.H tmlTextWriter.
|
| 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=MyNam espace.MyHtmlTe xtWriter
| </browserCaps>
|
| But I now get the following server error.
|
| [ConfigurationEx ception: The HttpBrowserCapa bilities string 'tagwriter'
| evaluated to 'MyNamespace.My HtmlTextWriter' . Could not load type
| MyNamespace.MyH tmlTextWriter from assembly System.Web,
Version=1.0.500 0.0,
| Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a. 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
| MyHtmlTextWrite r? 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=WebTa gWriters.DummyW riter,WebTagWri ters,Version=1. 0.2057.23025,Cu l
ture=neutral,Pu blicKeyToken=2e e82f19289eada7
</browserCaps>

the WebTagWriters.D ummyWriter type is in the WebTagWriters.d ll 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
Html32TextWrite r). 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: AcWj8dnR3tm5I45 ZT6ucpiHt2R90fw ==
| X-WBNR-Posting-Host: 194.200.242.250
| From: "=?Utf-8?B?TGVlIENoYXB tYW4=?=" <Le********@new sgroup.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************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA02.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1188 49
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.C ontrol.Render()
| to be my own object, MyHtmlTextWrite r, which inherits from
| System.Web.UI.H tmlTextWriter.
|
| 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=MyNam espace.MyHtmlTe xtWriter
| </browserCaps>
|
| But I now get the following server error.
|
| [ConfigurationEx ception: The HttpBrowserCapa bilities string 'tagwriter'
| evaluated to 'MyNamespace.My HtmlTextWriter' . Could not load type
| MyNamespace.MyH tmlTextWriter from assembly System.Web,
Version=1.0.500 0.0,
| Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a. 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
| MyHtmlTextWrite r? 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: AcWn6rdx87ybMs6 vS2C2/8z1U7d9WQ==
| X-WBNR-Posting-Host: 194.200.242.250
| From: "=?Utf-8?B?TGVlIENoYXB tYW4=?=" <Le********@new sgroup.nospam>
| References: <62************ *************** *******@microso ft.com>
<j4************ **@TK2MSFTNGXA0 1.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************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA02.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1197 21
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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=WebTa gWriters.DummyW riter,WebTagWri ters,Version=1. 0.2057.23025,Cu l
| > ture=neutral,Pu blicKeyToken=2e e82f19289eada7
| > </browserCaps>
| >
| > the WebTagWriters.D ummyWriter type is in the WebTagWriters.d ll
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
| > Html32TextWrite r). 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: AcWj8dnR3tm5I45 ZT6ucpiHt2R90fw ==
| > | X-WBNR-Posting-Host: 194.200.242.250
| > | From: "=?Utf-8?B?TGVlIENoYXB tYW4=?=" <Le********@new sgroup.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************ *************** *******@microso ft.com>
| > | 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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA02.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1188 49
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.C ontrol.Render()
| > | to be my own object, MyHtmlTextWrite r, which inherits from
| > | System.Web.UI.H tmlTextWriter.
| > |
| > | 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=MyNam espace.MyHtmlTe xtWriter
| > | </browserCaps>
| > |
| > | But I now get the following server error.
| > |
| > | [ConfigurationEx ception: The HttpBrowserCapa bilities string
'tagwriter'
| > | evaluated to 'MyNamespace.My HtmlTextWriter' . Could not load type
| > | MyNamespace.MyH tmlTextWriter from assembly System.Web,
| > Version=1.0.500 0.0,
| > | Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a. 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
| > | MyHtmlTextWrite r? 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
2591
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 crawlers. In an attempt to capture browsers with (UserAgent == null), I've added a case like this: <filter> <case match="^$"> crawler=true
0
1114
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/ but there site says they are creating a new version and to come back latter. Does anyone have a copy of this that they could post for me? That would...
1
1370
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 understanding (limited) it looks like you can implement the IConfigurationSectionHandler and use the IConfigurationSectionHandler.Create to intercept...
6
1818
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 SmartPhone are reconized wrong (IsMobileDevice = false). From where or how I get the a configuration which works? Thanks
10
2051
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 SmartPhone are reconized wrong (IsMobileDevice = false). From where or how I get the a configuration which works?
6
4586
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 very for different versions of NS also. Finally after a long search I found some article about browserCaps for machine config. I was not in a...
0
301
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 display will very for different versions of NS also. Finally after a long search I found some article about browserCaps for machine config. I was not...
1
2932
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 the local version. I thought about creating a web reference to the version I deployed to the server, but that means that I would have to change...
5
2174
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 in different environment, like development, building, testing.... Thanks. Daniel
0
7882
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8157
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8312
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7914
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6564
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5683
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3835
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1410
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.