Showing posts with label language. Show all posts
Showing posts with label language. Show all posts

Monday, March 26, 2012

Ajax Toolkit, calendar extender control

I have troubles with calendar control. When I tryed to run site with this control in Visual Studio i see the correct language - russian, but when i tryed to run deployed site using iis, i see english - names of months, days header.

i tryed to write in config files globalisation, ui culture, add charset win-1251, but no differences. i see only english words.

Have you set the EnableScriptGlobalization property to true in the scriptmanager?

yes


Hi

You should specifily its Culture and UICulture. Furture more, you should set ScriptManager's EnableScriptGlobalization and EnableScriptLocalization property to true.

EnableScriptLocalization: http://www.asp.net/AJAX/Documentation/Live/mref/P_System_Web_UI_ScriptManager_EnableScriptLocalization.aspx

EnableScriptGlobalization: http://www.asp.net/AJAX/Documentation/Live/mref/P_System_Web_UI_ScriptManager_EnableScriptGlobalization.aspx

Here is the sample.

<%@. Page Language="C#" Culture="ru-RU" UICulture="ru"%><%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" > </asp:ScriptManager> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:Button ID="Button2" runat="server" Text="hide" OnClientClick="return hideCalendar()"/> <asp:Button ID="Button1" runat="server" Text="show" OnClientClick="return false;"/> <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" PopupButtonID="Button1" > </ajaxToolkit:CalendarExtender> </form></body></html>

I hope this help.

Best regards,

Jonathan

AJAX Toolkit Localized Versions of DLL

Hello,

When I add a reference to the most recent version of the DLL of AJAXControlToolkit, it includes all the other language versions as well. In my application, I am not going to need this, and don't want all 14 versions also copied over to my bin folder. Is there any way I can remove them and stop having them come back over after compiling? Can I delete those when I copy to the server and not have any problems with the toolkit?

You only need to copy the languages you care about. So if en-us is all that you want just the AjaxControlToolkit.dll should be sufficient. If your users are in different locales and you would like them to view the localized versions of the toolkit controls then you should copy over the rest. Right now we do not have a workaround to not build everything but it is on ourradar.

AJAX TOOLKIT - TAB CONTROL- scripts

I was watching the video about this control, its great, but i have got a lot of questions. First: Why is the script language javascript?. I have tried using vbscript but it showed me some errors, so its a must javascript for AJAX controls?.

Whats the diference btween type=text/javascript, and language=javascript.

Hi,

Basically, you can use vbscript to call functions defined in javascript library via call statement. But, in my opinion, it's rather annoying to try to achieve this, and strongly recommend you using javascript directly.

Imnoob007:

Whats the diference btween type=text/javascript, and language=javascript.

They are tags used be browser to detect what's the type of the script, and there is no significant difference between them.


The J in ajax stands for javascript... If you're not used to javascript, don't worry about it, it's easy to learn and there are millions of tutorials and always an answer when you google "javascript [key words]"

(http://www.w3schools.com/ is my favorite)


Thnx guys. thnx for ur time. Now im best informed :)

Saturday, March 24, 2012

AJAX timer and updatepanel updates entire page!

Hi,

Below is a sample of a very simple page:

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Data_test" Title="Untitled Page" %>
<%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@dotnet.itags.org. Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Timers</title>
</head>
<body>sdfsdf
<form id="form1" runat="server">sdsdf
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:Timer runat="server" id="UpdateTimer" interval="5000" ontick="UpdateTimer_Tick" />
<asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
</Triggers>
<ContentTemplate>
<asp:Label runat="server" id="DateStampLabel" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>

and the codebehind:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Xml;
using AjaxControlToolkit;

public partial class Data_test : BasePage
{

protected override void Page_Load(object sender, EventArgs e)
{
// Run common functionality in Base page
base.Page_Load(sender, e);

if (User.Identity.IsAuthenticated == false)
{
Server.Transfer("~/Default.aspx");
}

Page.MaintainScrollPositionOnPostBack = true;
}

protected void UpdateTimer_Tick(object sender, EventArgs e)
{
DateStampLabel.Text = DateTime.Now.ToString();
}

}

When I run this, the whole page is refreshed, not just the label in the updatepanel!!!

Why is this??

Thanks,

Kreid

Hey,

Just to be safe, try adding EnablePartialRendering="true" to the script manager. Also, you may want to try putting the timer within the update panel, and see if that is the issue.


Thanks for your reply.

EnablePartialRendering was set to to true. I also just tried to put the timer inside the updatepanel, and set updatemode = Always. No change - the whole page is still updated.

:( Any more ideas?

bmains:

Hey,

Just to be safe, try adding EnablePartialRendering="true" to the script manager. Also, you may want to try putting the timer within the update panel, and see if that is the issue.


Keep in mind the code in your Page_Load is going to be executed in partial postbacks. Wrap that Page_Load code in if (!IsPostBack) { }, and it should work as expected.