M
Milsnips
Hi all.
i'm tryng to implement the Rewrite.NET url rewritining functionality into a
test project i've created, however i am hitting a problem at this line
(direct from the web example):
System.Collections.Specialized.NameValueCollection SectionIndex =
(System.Collections.Specialized.NameValueCollection)System.Configuration.ConfigurationSettings.GetConfig("Rewrite.NET/Index");
The value always returns me null, and just to check it was reading from the
same web.config, i added a, appSettings value which i could read fine.
These code examples are directly off the web example and nothing is changed,
however the above call to find "GetConfig" section returns null and i dont
know why?? any help appreciated!
Here is what my web.config looks like:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="Rewrite.NET">
<section name="SimpleSettings"
type="System.Configuration.NameValueSectionHandler,System" />
</sectionGroup>
</configSections>
<Rewrite.NET>
<SimpleSettings>
<!-- sample test page urls to rewrite -->
<add key="/Default.aspx?page=Home" value="/default.aspx" />
<add key="/Default.aspx?page=About" value="/about.aspx" />
<add key="/Default.aspx?page=Contact" value="/contact.aspx"
/>
</SimpleSettings>
</Rewrite.NET>
<appSettings>
<add key="test" value="test"></add>
</appSettings>
<connectionStrings/>
<system.web>
<httpModules>
<add type="Rewrite.NET.Rewrite,Rewrite.NET"
name="Rewrite.NET" />
</httpModules>
<compilation debug="true" />
<authentication mode="Windows" />
</system.web>
</configuration>
thanks,
Paul
i'm tryng to implement the Rewrite.NET url rewritining functionality into a
test project i've created, however i am hitting a problem at this line
(direct from the web example):
System.Collections.Specialized.NameValueCollection SectionIndex =
(System.Collections.Specialized.NameValueCollection)System.Configuration.ConfigurationSettings.GetConfig("Rewrite.NET/Index");
The value always returns me null, and just to check it was reading from the
same web.config, i added a, appSettings value which i could read fine.
These code examples are directly off the web example and nothing is changed,
however the above call to find "GetConfig" section returns null and i dont
know why?? any help appreciated!
Here is what my web.config looks like:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="Rewrite.NET">
<section name="SimpleSettings"
type="System.Configuration.NameValueSectionHandler,System" />
</sectionGroup>
</configSections>
<Rewrite.NET>
<SimpleSettings>
<!-- sample test page urls to rewrite -->
<add key="/Default.aspx?page=Home" value="/default.aspx" />
<add key="/Default.aspx?page=About" value="/about.aspx" />
<add key="/Default.aspx?page=Contact" value="/contact.aspx"
/>
</SimpleSettings>
</Rewrite.NET>
<appSettings>
<add key="test" value="test"></add>
</appSettings>
<connectionStrings/>
<system.web>
<httpModules>
<add type="Rewrite.NET.Rewrite,Rewrite.NET"
name="Rewrite.NET" />
</httpModules>
<compilation debug="true" />
<authentication mode="Windows" />
</system.web>
</configuration>
thanks,
Paul