Showing posts with label upgraded. Show all posts
Showing posts with label upgraded. Show all posts

Saturday, March 24, 2012

AJAX and Vista -

I just upgraded to Vista from XP where I had IIS running very happily and AJAX installed and working great.

After upgrading to Vista I get this browser error on any AJAX website:

'Sys' is undefined

I remember seeing that error months ago back when it was called Atlas. But now that I'm running the latest OS, with a non-beta AJAX, why should I be getting this now? The upgrade to Vista has been painful all around, but I've managed to fix or find workarounds for most problems except this one.

It seems like the AJAX stuff isn't getting included into the webpage. I even tried creating a fresh project in VWD and specifying to use the VS template for "ASP.Net Ajax Enabled Website" and throwing together a simple page with an updatepanel and a command button. Same error.

I've run Windows Update and gotten all the updates, including the Visual Studio update that tells you to run VWD "as an administrator", which I'm doing.

The line in the generated page that it is complaining about is the first reference to Sys below.
Hopefully there is just some simple security setting in this locked down OS I don't know about to allow this to run? 
<script type="text/javascript">//<![CDATA[Sys.WebForms.PageRequestManager._initialize('ScriptManager1', document.getElementById('form1'));Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tUpdatePanel1'], [], [], 90);//]]>
</script>

Do you have following entry in your web.confg file?

<add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>

Also, follow Readme notes on migration issues on ajax.asp.net .


Yes, I have that. This was a functioning ASP.Net 2.0/AJAX 1.0 application when I had XP, but now that I'm running windows Vista, it doesn't work.

I did have to manually edit applicationHost.config in C:\windows\system32\inetsrv\config to add entries for ASP.Net 2.0 (it only had enties for 1.1), so I'm wondering if something must be added there to support AJAX.

I tried downloading and re-installing AJAX, rebooting, all the obvious stuff with no luck. Upgrading to Windows has ALMOST completely shut me down from developing.

I did just discover that when I use the VWD built in web server, AJAX works fine. So AJAX is "installed" correctly on my PC. But as far as when I use the full-blown IIS web server, AJAX is dead.

I didn't see anything in the README relating to Vista migration, only migration from previous versions of Ajax/Atlas, which is not what I'm doing.


Here is what I ended up doing as I spent nearly two days trying to rebuild my Dev machine after purchasing a Vista capable laptop.

1. Mark your site in IIS7 as an Application (The choice is there if you right click on virtual IIS7 entry in the expanded list under websites...

2. Make sure that you have included all of the IIS7 web.config entries:

<

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.-->

<

authenticationServiceenabled="true"requireSSL="false" />

<!--

Uncomment these lines to enable the profile service. To allow profile properties to be retrieved

and modified in Atlas applications, you need to add each property name to the setProperties and

getProperties attributes.

-->

<!--

<profileService enabled="true"

setProperties="propertyname1,propertyname2"

getProperties="propertyname1,propertyname2" />

-->

</

webServices>

</

scripting>

</

system.web.extensions>

<

system.webServer>

<

validationvalidateIntegratedModeConfiguration="false"/>

<

modules>

<

addname="ScriptModule"preCondition="integratedMode"type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</

modules>

<

handlers>

<

removename="WebServiceHandlerFactory-Integrated"/>

<

addname="ScriptHandlerFactory"verb="*"path="*.asmx"preCondition="integratedMode"type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<

addname="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"/>

<

addname="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>

Note that the PipeLine extension for the configured site can be set for Integrated (default) instead of the Classic Mode.

With those two steps I was able to get a XP configured site migrated over with Ajax...


My web site is set up as an application, and it uses an application pool set up for ASP.net 2.0.

When I set that application pool to use to use the Integrated mode, I can no longer even load my website (gives 404 error).

This is crazy, this was a perfectly functioning website under XP, and "upgrading" to vista has broken it.

Is there anything in the applicationHost.config file that needs to reference AJAX? I'm at the end of my rope here, I'm about to just install XP and loose ALL my programs and setting just to get back to a usable machine!

ajax and profileservice

I upgraded my web server to asp ajax 1.0 and changed my web.config to work with ajax 1.0.

my profile provider no longer works, whenever i attempt to access it, the application attempts to connect to a sqlexpress 2005 server and tries to create it in the app_data, however my connectoin string is for a sql2000 server tha thas the asp membership tables created in it

the error given is

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

SQLExpress database file auto-creation error:

The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:

    If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.Sql Server Express must be installed on the machine.The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.

all was working before i updated to ajax 1.0 when the namespaces were microsoft.web

how do i fix this?

nevermind, it was defaulting to localsqlserver connection string which was set to a sqlexpress database