Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BrowserCaps config file

Status
Not open for further replies.

txmed

Programmer
Mar 23, 2006
65
US
Greetings. I am trying to configure a web app to detect if any web crawlers are accessing my site. I've created a BrowserCaps.config file that has only 1 browser (for now). I then modified my Web.config file to link to the BrowserCaps.config file.

Web.config file:
Code:
<?xml version="1.0"?>

<configuration>
	<system.web>
    <browserCaps configSource="BrowserCaps.config" />
    <compilation debug="true"/>
    <authentication mode="Windows"/>
  </system.web> 
</configuration>


BrowserCaps.config file:
Code:
<?xml version="1.0"?>

<browserCaps>
  <browsers>
    <browser id="GenericDownlevel" parentID="Default">
      <identification>
        <userAgent match="^Generic Downlevel$" />
      </identification>
      <capture>
      </capture>
      <capabilities>
        <capability name="cookies"                     value="false" />
        <capability name="ecmascriptversion"           value="1.0" />
        <capability name="tables"                      value="true" />
        <capability name="type"                        value="Downlevel" />
      </capabilities>
      <controlAdapters>
        <adapter controlType="System.Web.UI.WebControls.Menu"
        adapterType="System.Web.UI.WebControls.Adapters.MenuAdapter" />
      </controlAdapters>
    </browser>
  </browsers>      
</browserCaps>


When I run the application I get this error message:
Parser Error Message: Server found the unknown tag <browsers> in capabilities configuration.

The line <browsers> in the BrowserCaps.config is highlighted in red.

Can someone please look at this and let me know what I am doing wrong?

Thanks,

(txmed)
 
I haven't used this feature before, but the first result of a google search returned the MSDN page. your configs don't look anything like the MSDN configs. The highlighted note also says this should be in a .browser file, not the web.config.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
jmeckley,

Thank you for your prompt reply. I did find that MSDN page and I worked on it for a while but I could not get it to work. I'll continue trying.

In the meantime, does anyone else know what I am doing wrong?

Thanks,

(txmed)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top