English 中文(简体)
Silverlight 3 different behavior between browsers
原标题:

I have a silverlight project that runs normally, its just a listbox that retrieivies some value. This project run correctly in Internet explorer but do not runs correctly in Safari 4 or Firefox 3.5.... Does silverlight have some difference in terms of behavior that can vary from browser to browser?

Here s the error that happens in the non IE Browsers

Refused to set unsafe header "Accept-Charset" Error: System.InvalidOperationException: An error occurred while saving changes. See the inner exception for details. ---> System.Data.Services.Http.WebException: Internal error at HttpWebResponse.NormalizeResponseStatus .

at System.Data.Services.Http.HttpWebResponse.NormalizeResponseStatus(Int32& statusCode)

at System.Data.Services.Http.HttpWebResponse..ctor(HttpWebRequest request, Int32 statusCode, String responseHeaders)

at System.Data.Services.Http.HttpWebRequest.CreateResponse()

at System.Data.Services.Http.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

at System.Data.Services.Client.QueryAsyncResult.AsyncEndGetResponse(IAsyncResult asyncResult)

--- End of inner exception stack trace ---

at System.Windows.Browser.ManagedObjectInfo.Invoke(ManagedObject obj, InvokeType invokeType, String memberName, ScriptParam[] args)

at System.Windows.Browser.ManagedObject.Invoke(InvokeType invokeType, Int32 memberID, ScriptParam[] args)

at System.Windows.Hosting.ScriptingInterface.InvokeScriptableMember(ManagedObject obj, InvokeType invokeType, Int32 memberID, ScriptParam[] args, ScriptParam& pResult)

at System.Windows.Hosting.ManagedHost.InvokeScriptableMember(IntPtr pHandle, Int32 nMemberID, Int32 nInvokeType, Int32 nArgCount, ScriptParam[] pArgs, ScriptParam& pResult, ExceptionInfo& pExcepInfo)

问题回答

Silverlight uses the HTTP stack provided by the host browser to access data from the server. Hence there can be variations in the way HTTP behaves from one browser to another. This looks like it may be the case here.

In addition to what Anthony wrote, you can switch from Browser HTTP stack, which is used by default to Silverlight HTTP stack (introduced in Silverlight 3, AFAIR).

As long as I faced similar problem and found a solution, I wrote a post elaborating on this with some code samples.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签