Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Wednesday, March 28, 2012

Asp.Net Ajax Script Library Books

Hi. I think it's going to be quite hard to find books that wil cover only the client-side part of the Asp.Net Ajax Library, but I'm looking for, at least, some books that will have a great emphasis in the client-side part. Can anyone suggest some books that will target the client-side part of the Asp.Net Ajax Library?

ASP.NET Ajax in Action covers the client-side library pretty well. Have a look at the sample Chapter 2 here:http://www.manning.com/gallo/


Hi. Just finished reading the Chapter 2 of ASP.NET AJAX in Action.
This book appears to be a serious one! It's very well written.

But in case someone else have read another good book that target the
cleint-side library, please post here.


Have a look at

Programming ASP.NET AJAX http://www.oreilly.com/catalog/9780596514242/

Asp.net Ajax Enabled web app creating more ScriptResource.axd on a Simple page

Hello,

I am using Asp.net Ajax extension 1.0.In my application ,I am using a index.aspx page,which have no script manager control.When i am runing this application the the index page is loading very slow.When I save the page from browser I am finding six ScriptResource.axd files are loading on client side.Which have up to 400 kb.So I want to reduce these files on index page.But I do not know how I do it.Please help me.

Regards,

Pawan

Hi Pawan,

Basically, those scripts won't be requested if there is no AJAX related controls on the form.
If you are using MasterPage and there is ScriptManager on it, they will be downloaded too.

Hope this helps.

Hello Raymond Wen,

Thanks for reply.

I am using asp.net ajax enable website1.0.I have noticed that ScriptResource.axd is uploaded each time when I am navigate the site.On each page ScriptResource.axd is again loading.I want to cache ScriptResource.axd on Client Side.If you have any idea about it then please help me. Thanks & Regards, Pawan


Please try the following:

1. Set debug to false in web.config

2. Set ScriptMode property of the ScriptManager to release


These should be cached on the client as long as you have <Compilation Debug="false" /> in your web.config.

Saturday, March 24, 2012

ASP,NET AJAX Enabled site and script module error

Hi All,

I have an ASP.NET AJAX enabled site which works OK in my development environment but when I publish it and view the site I get the error below. I have also tried creating a fresh ASP.NET AJAX enabled site and then publishing it but still the same error. Thinking some files were missing I downloaded the MS AJAX setup on my server (Win2K3 64-bit SP1) but to no avail.

From my Googling I see there are some patches to fix various issues with AJAX but nothing I have found matches my problem. If anyone has any info on this error or could point me in the right direction that would be most appreciated.

Description:Anerror occurred during the processing of a configuration file requiredto service this request. Please review the specific error details belowand modify your configuration file appropriately.

Parser Error Message:Couldnot load file or assembly 'System.Web.Extensions, Version=1.0.61025.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of itsdependencies. The system cannot find the file specified.(xxxxx\web.config line 42)

Source Error:

Line 40:
Line 41: <httpModules>
Line 42: <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Line 43: </httpModules>
Line 44: </system.web>

The AJAX assemblies are intended to be installed in the servers GAC, therefore they will not deploy in your apps bin folder.

Run the AJAX installation on the server to install the assemblies to the severs GAC.


Thanks for the prompt response. I had tried seveal times to download and install the same AJAX setup on my server. Though I thought I'd give it one last try after your comment and it nows works :)

Wednesday, March 21, 2012

ArgumentOutOfRangeException when calling a web service

I have a script service that is failing for some (but not all) clients. Below is the stack trace. My understanding is that Script Handler is failing to understand the request and bombs out when trying to send a json string representation of the problem. This is making it hard for me to determine what the cause of the problem is. Has anyone else seen this happen before?

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
at System.Text.StringBuilder.Append(String value, Int32 startIndex, Int32 count)
at Microsoft.Web.Script.Serialization.JavaScriptString.QuoteString(String value)
at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeString(String input)
at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal (Object o)
at Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o)
at Microsoft.Web.Services.RestHandler.WriteExceptionJsonString(HttpContext context, TextWriter writer, Exception ex)
at Microsoft.Web.Services.RestHandler.ProcessRequest(HttpContext context)
at Microsoft.Web.Services.ScriptHandlerFactory.HandlerWrapper.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute ()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

It seems you are having problem with serialization, you are trying to serialize which is not supoorted with default JavaScriptSeriallizer, Try FireBug forFF or Fiddler for IE to trace the JSOn string. You can also paste the code here which we can investigate.