Showing posts with label Ajax. Show all posts
Showing posts with label Ajax. Show all posts

June 25, 2007

Encoding Problem and Solution For Asp.Net Ajax

I have been setting the encodings (for Turkish encoding) for my Asp.Net sites as follows, which is a standard way and working perfectly:

<globalization requestEncoding="windows-1254" responseEncoding="windows-1254" fileEncoding="windows-1254" />

But when I started using Ajax Asp.Net 1.0 with the same settings, I got scrambled characters for Turkish characters. This seems to be a bug.

I posted the problem to Asp.Net forums and stmarti comes with a workaround for it that saves a lot of work of saving every page of the site with UTF-8 encoding.(http://forums.asp.net/p/1115099/1726111.aspx#1726111)

Here is the workaround setting:
<globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="windows-1254" responseHeaderEncoding="windows-1254" />

You can change the windows-1254 to any encoding that will work for you.
Tankut

May 17, 2007

AJAX Timer and Focus Lost Problem

If you have an AJAX time updating a updatepanel, you can have the textboxes and other controls out of this update panel loses focus.

Solution is to put other controls into another updatepanel and have both of these updatepanels UpdateMode="Conditional". That will do the trick.

Tankut

January 27, 2007

ASP.NET AJAX v1.0 Released

Also Microsoft released ASP.NET Ajax v1.0. Get if from http://ajax.asp.net/

October 23, 2006

Setting SelectedValue of Cascading DropDown

For a cascading dropdown with such a definition:

< id="CascadingDropDownState" runat="server">< /cc1:cascadingdropdown >

< category="State" prompttext="Select State" selectedvalue="CO" servicemethod="getState" servicepath="GetWebServiceData.asmx" targetcontrolid="ddlState">< /cc1:cascadingdropdownproperties>

you can use this code to set selectedvalue from code:

CascadingDropDownProperties props = CascadingDropDownState.GetTargetProperties(ddlState);

props.SelectedValue = "CO";

You can also see the ASP.NET forum thread