Showing posts with label section. Show all posts
Showing posts with label section. Show all posts

Saturday, March 24, 2012

Configuration Section

I watched the video about how to add the ajax functionality to an existing web application which was previously not Ajax aware.

I added the following to the following to the <configuration> area:

<configSections>

<sectionGroupname="system.web.extensions"type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

<sectionGroupname="scripting"type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

<sectionname="scriptResourceHandler"type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"allowDefinition="MachineToApplication"/>

<sectionGroupname="webServices"type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

<sectionname="jsonSerialization"type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"allowDefinition="Everywhere"/>

<sectionname="profileService"type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"allowDefinition="MachineToApplication"/>

<sectionname="authenticationService"type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"allowDefinition="MachineToApplication"/>

</sectionGroup>

</sectionGroup>

</sectionGroup>

</configSections>

My problem is that I also have an <appSettings> section, which I placed the above after the </appSettings>. When I attempt to compile, I get an error which states the following: "ASP.NET runtime error: Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration> element. "

How do I correct this error?

Hello,

Maybe if you put the <AppSettings> after the <ConfigSections> ?

"<configSections> if present must be the first child of the root <configuration> element."

Marchu

Wednesday, March 21, 2012

Composite Control and CalendarExtender error

I'm trying to create a server control that wraps up a TextBox, calendar Image, and a AJAX 1.0 CalendarExtender. Here is a section of the code:

protected override void CreateChildControls() {txtDate.Width = 75;Controls.Add(txtDate);imgCal.ImageUrl= _iconURL;imgCal.ImageAlign= ImageAlign.AbsMiddle;Controls.Add(imgCal);calEx.PopupButtonID= imgCal.UniqueID;calEx.TargetControlID= txtDate.UniqueID;Controls.Add(calEx);}

Here is the runtime error I am getting:

"'_behaviors' is null or not an object"

Any ideas?

Looks like there is a little information about adding the behaviors here:

http://forums.asp.net/thread/1293293.aspx#13

But this leeds me to believe I need a client script on every page I plan to have this control. Which isn't really acceptable.

Is there a way to wrap it up in one compiled control?


Did you have any luck doing this? I'm in the process of doing the exact same thing.

Also, I'm having problems finding the Calendar Extender control to dynamically add it. I'm sure I'm missing something. I've tried adding references to the AjaxControlToolkit and the AJAXExtensionsToolbox, but no luck in finding it. I do see the AjaxControlToolkit namespace and several controls under it, just no Calendar.

Thanks In Advance!


Firgured out the problem... somehow the older version of the AjaxControlTool.dll got in there.

I got it working great!