Re: Customizing Web.Config
Just a guess since this is an ASP.NET question...
Dont you need a space before the escape char?
VB Code:
<section name="MySection" type="MySectionHandler"/>
<section name="MySection" type="MySectionHandler" />
???
Also, is that the complete xml heirachy for your section?
Re: Customizing Web.Config
Thanks for the response Rob, but I figured it out. It actually requires the fully qualified name of the object to be created:
<section name="MySection" type="webconfigtest.MySectionHandler,webconfigtest"/>
I changed it and it works.
Re: Customizing Web.Config
Cool! Always good to learn something new. Thanks. :)
Ps, now since you solved it yourself you need to give yourself a Rep. :D jk
Re: Customizing Web.Config
Hi Guys
Sorry for extending this disucssion but I was looking for a similar solution but in a VB.NET application. Based on your sample <section name="MySection" type="webconfigtest.MySectionHandler,webconfigtest"/> it would appear that webconfigtest is a DLL. I am writing an executable, say vbtest.exe, and wanted to include the Section handler within the same application so I set my section entry as
Code:
<section name="MySection" type="MySectionHandler" />
but I get an error while retrieving the section data.
I would like to know if the customer section handler class should necessarily be in a seperate DLL?
Thanks for your help.
Re: Customizing Web.Config
It doesn't require a separate DLL, however it does require the full name of the object. It is probably ProjectName.Classname in the case of the class in your executable.
Re: Customizing Web.Config
Thanks Negative0. It works. I tried
VB Code:
<section name="articlesVB" type="VBNetLab.CustomTagHandler, VBNetLab" />
and it worked. So it would appear that the type part should be something like this:
VB Code:
type="Assembyname.ClassName, AssemblyName"
where Assembly name is the name of the executable.
Thanks