CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums



Zone: > Asp.Net Forum > asp.net_ajax.asp.net_ajax_ui Tags:
Item Type: Date Entered: 1/7/2008 4:36:09 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 8 Views: 2411 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
9 Items, 1 Pages |< << Go >> >|
"Shivonne" <>
NewsGroup User
Sys.ArgumentUndefinedException: Value cannot be undefined.9/25/2007 3:15:45 AM

0

Hi all

 I'm trying to recreate one of the examples from the Developing Enhanced Web Experiences with Microsoft? ASP.NET AJAX Extensions clinic.

 I have the following javascript code in my page:

<script language="javascript" type="text/javascript">
	<!--
		var helpButton;
		var helpDiv;
		
		var hoverBehavior;
		var popupBehavior;
		var chooseANumber;
		var toolTipDiv;
		
		function pageLoad (sender, e)
		{
			// rollover and popup behaviour
			toolTipDiv = $get('tooltipDiv');
			chooseANumber = $get('chooseANumber');
			
			popupBehavior = $create(Sys.Preview.UI.PopupBehavior, 
				{'parentElement':$get('chooseANumber'),
				'positioningMode':Sys.Preview.UI.PositioningMode.BottomLeft},
				null, null, toolTipDiv);
			
			hoverBehavior = $create(Sys.Preview.UI.HoverBehavior,
				null,
				{'hover':onHover, 'unHover':onUnhover},
				null, chooseANumber);
			
			// Click behaviour
			helpDiv = $create(Sys.Preview.UI.Label, null, null, null, $get('helpDiv'));
			helpDiv.set_visibilityMode(Sys.UI.VisibilityMode.collapse);
			helpButton = $create(Sys.Preview.UI.Button, null, {'click':onClick},
				null, $get('helpButton'));
		}
		
		function onClick()
		{
			if (helpDiv.get_visible())
			{
				helpDiv.set_visible(false);
			}
			else
			{
				helpDiv.set_visible(true);
			}
		}
		
		function onHover()
		{
			popupBehaviour.show();
		}
		
		function onUnhover()
		{
			popupBehaviour.hide();
		}
	//-->
    </script> 

I get an error on the popupBehavior = $create(Sys.Preview.UI.PopupBehavior ... line:

Sys.ArgumentUndefinedException: Value cannot be undefined.
Parameter name: type

Can anyone help with this, please?

Thanks as always

Shivonne

"Suprotim Agarw
NewsGroup User
Re: Sys.ArgumentUndefinedException: Value cannot be undefined.9/25/2007 10:51:12 AM

0

Hi,

This error 'usually' occurs if your web.config is not updated with ajax configuration settings.

To make your site ajax enabled, you have to make some changes in the web.config. Hope you have done that.

HTH.

Suprotim Agarwal


Don't forget to click "Mark as Answer" on the post that helped you. This will help readers to know which post solved your issue and make their search easy
"dwhite" <>
NewsGroup User
Re: Sys.ArgumentUndefinedException: Value cannot be undefined.9/25/2007 11:20:32 AM

0

Suprotim Agarwal:
This error 'usually' occurs if your web.config is not updated with ajax configuration settings.

If this is the case, check out http://blogs.visoftinc.com/archive/2007/09/23/asp.net-ajax--updatepanel-not-working--common-problems.aspx for common AJAX issues and how to fix them.

-Damien


** Remember to mark posts as the answer to help future users. **
Visoft, Inc - Web Site | Blogs
"Shivonne" <>
NewsGroup User
Re: Sys.ArgumentUndefinedException: Value cannot be undefined.9/25/2007 9:26:37 PM

0

Hi all

Thanks for the responses. I created the project as a new ASP AJAX Futures Web Application Project so that should have added everything necessary to the web.config. I did go to the site referenced and changed my web.config as follows just in case:

<configuration>

	<configSections>
		<sectionGroup name="system.web.extensions"
        type="System.Web.Configuration.SystemWebExtensionsSectionGroup, 
        System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, 
        PublicKeyToken=31bf3856ad364e35">
			<sectionGroup name="scripting"
        type="System.Web.Configuration.ScriptingSectionGroup, 
        System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, 
        PublicKeyToken=31bf3856ad364e35">
				<section name="scriptResourceHandler"
					type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, 
            System.Web.Extensions, Version=1.0.61025.0, 
            Culture=neutral, PublicKeyToken=31bf3856ad364e35"
					requirePermission="false"
					allowDefinition="MachineToApplication"/>
				<sectionGroup name="webServices"
            type="System.Web.Configuration.ScriptingWebServicesSectionGroup, 
            System.Web.Extensions, Version=1.0.61025.0, 
            Culture=neutral, PublicKeyToken=31bf3856ad364e35">
					<section name="jsonSerialization"
              type="System.Web.Configuration.ScriptingJsonSerializationSection, 
              System.Web.Extensions, Version=1.0.61025.0, 
              Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              requirePermission="false" allowDefinition="Everywhere" />
					<section name="profileService"
              type="System.Web.Configuration.ScriptingProfileServiceSection, 
              System.Web.Extensions, Version=1.0.61025.0, 
              Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              requirePermission="false"
              allowDefinition="MachineToApplication" />
					<section name="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>

  <appSettings/>
  <connectionStrings/>

  <system.web>
    <!--
          Set compilation debug="true" to insert debugging
          symbols into the compiled page. Because this
          affects performance, set this value to true only
          during development.
    -->
    <compilation debug="false">
      <assemblies>
				<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="Microsoft.Web.Preview, Version=1.2.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </assemblies>
      <buildProviders>
        <add extension="*.asbx" type="Microsoft.Web.Preview.Services.BridgeBuildProvider"/>
      </buildProviders>
    </compilation>
		
		<pages>
			<controls>
				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			</controls>
		</pages>
    
		<!--<pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI" assembly="Microsoft.Web.Preview"/>
        <add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI.Controls" assembly="Microsoft.Web.Preview"/>
        <add tagPrefix="asp" namespace="Microsoft.Web.Preview.Search" assembly="Microsoft.Web.Preview"/>
        <add tagPrefix="asp" namespace="Microsoft.Web.Preview.Diagnostics" assembly="Microsoft.Web.Preview"/>
      </controls>
    </pages>-->

    <httpHandlers>
			<remove verb="*" path="*.asmx"/>
			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
		</httpHandlers>

	<httpModules>
		<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
		<xhtmlConformance mode="Transitional"/>
  </system.web>

	<system.web.extensions>
		<scripting>
			<webServices>
				<!-- Uncomment this line to customize maxJsonLength and add a 
         custom converter -->
				<!--
      <jsonSerialization maxJsonLength="500">
        <converters>
          <add name="ConvertMe" 
             type="Acme.SubAcme.ConvertMeTypeConverter"/>
        </converters>
      </jsonSerialization>
      -->
				<!-- Uncomment this line to enable the authentication service. 
           Include requireSSL="true" if appropriate. -->
				<!--
      <authenticationService enabled="true" requireSSL = "true|false"/>
      -->

				<!-- Uncomment these lines to enable the profile service. To 
           allow profile properties to be retrieved
           and modified in ASP.NET AJAX applications, you need to add 
           each property name to the readAccessProperties and
           writeAccessProperties attributes. -->
				<!--
      <profileService enabled="true"
        readAccessProperties="propertyname1,propertyname2"
        writeAccessProperties="propertyname1,propertyname2" />
      -->
			</webServices>
			<!-- 
    <scriptResourceHandler enableCompression="true" 
        enableCaching="true" />
    -->
		</scripting>
	</system.web.extensions>


	<!-- 
  The system.webServer section is required for running ASP.NET AJAX under Internet
  Information Services 7.0.  It is not necessary for previous version of IIS.
  -->
	<system.webServer>
		<validation validateIntegratedModeConfiguration="false" />
		<modules>
			<add name="ScriptModule"
				preCondition="integratedMode"
				type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
		</modules>
		<handlers>
			<remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
			<add name="ScriptHandlerFactory" verb="*" path="*.asmx"
				preCondition="integratedMode"
				type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add name="ScriptHandlerFactoryAppServices" verb="*"
				path="*_AppService.axd" preCondition="integratedMode"
				type="System.Web.Script.Services.ScriptHandlerFactory, 
      System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, 
      PublicKeyToken=31bf3856ad364e35"/>
			<add name="ScriptResource" preCondition="integratedMode"
				verb="GET,HEAD" path="ScriptResource.axd"
				type="System.Web.Handlers.ScriptResourceHandler, 
      System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, 
      PublicKeyToken=31bf3856ad364e35" />
		</handlers>
	</system.webServer>
</configuration>

Still gives me the same JavaScript error though.

Thanks as always

Shivonne

"Shivonne" <>
NewsGroup User
Re: Sys.ArgumentUndefinedException: Value cannot be undefined.9/26/2007 7:49:32 PM

0

Anyone able to assist with this please?

"Raymond Wen -
NewsGroup User
Re: Sys.ArgumentUndefinedException: Value cannot be undefined.9/29/2007 7:59:10 AM

0

 Hi Shivonne,

I don't have this version on my machine yet. But my suggestions for you is to debug your script to find out the actual cause.

Please refer to this documentation for more information: http://msdn2.microsoft.com/en-us/library/k2h50zzs(VS.80).aspx
 


Sincerely,
Raymond Wen
Microsoft Online Community Support
"Shivonne" <>
NewsGroup User
Re: Sys.ArgumentUndefinedException: Value cannot be undefined.9/30/2007 7:02:17 PM

0

Thanks Raymond. I'll check that out and see what I can find. 

"Shivonne" <>
NewsGroup User
Re: Sys.ArgumentUndefinedException: Value cannot be undefined.9/30/2007 8:34:15 PM

0

It fails in the $create function on line 15:

1    var $create = Sys.Component.create = function Sys$Component$create(type, properties, events, references, element) {
2        /// <param name="type" type="Type"></param>
3        /// <param name="properties" optional="true" mayBeNull="true"></param>
4        /// <param name="events" optional="true" mayBeNull="true"></param>
5        /// <param name="references" optional="true" mayBeNull="true"></param>
6        /// <param name="element" domElement="true" optional="true" mayBeNull="true"></param>
7        /// <returns type="Sys.UI.Component"></returns>
8        var e = Function._validateParams(arguments, [
9            {name: "type", type: Type},
10           {name: "properties", mayBeNull: true, optional: true},
11           {name: "events", mayBeNull: true, optional: true},
12           {name: "references", mayBeNull: true, optional: true},
13           {name: "element", mayBeNull: true, domElement: true, optional: true}
14       ]);
15       if (e) throw e;

 It looks like it doesn't recognise the Sys.Preview.UI.Data.PopupBehavior value I am passing in.

I have the following ScriptManager in my code:

<asp:ScriptManager ID="ScriptManager1" runat="server" enablepagemethods="true" enablepartialrendering="true" scriptmode="Debug">
   <Scripts>
      <asp:ScriptReference Assembly="Microsoft.Web.Preview" Name="PreviewScript.js" />
   </Scripts>
</asp:ScriptManager>

 Is there anything else I should have configured in the ScriptManager besides this? 

 

"jmh-dot-net" <
NewsGroup User
Re: Sys.ArgumentUndefinedException: Value cannot be undefined.10/26/2007 7:50:44 PM

0

I'm receiving the same JavaScript error. I've gone through the same steps as above, I installed the ASP.NET Futures (July 2007) release, and created a new ASP.NET AJAX Futures Web Application via Visual Studio New Projects templates. I've successfully got other components working such as the TimerControl (part of ASP.NET Futures) on the same ASP.NET page. Searching on Google for "Sys.Preview.UI.PopupBehavior" I see other people with the same with issue, unresolved.

I assume it is reference missing, but I cannot find any docs that list requirements to use this object. Has anyone resolved this problem?

9 Items, 1 Pages |< << Go >> >|



Free Download:






   
  Privacy | Contact Us
All Times Are GMT