<asp:Content ID="Content2" ContentPlaceHolderID="main" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<script type="text/javascript" language="javascript">
function EnableTransalationTelugu() {
google.load("elements", "1", {
packages: "transliteration"
});
function onLoad() {
var options = {
sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage: [google.elements.transliteration.LanguageCode.TELUGU],
shortcutKey: 'ctrl+g',
transliterationEnabled: true
};
var control = new google.elements.transliteration.TransliterationControl(options);
control.makeTransliteratable(['main_txtdescription']);
//TEXT1 is the id of the control which you will use for the transliteration.
}
google.setOnLoadCallback(onLoad);
}
</script>
<asp:CheckBox ID="chktelugu" runat="server" Text="Telugu" onclick="CheckOne(this);"
AutoPostBack="true" OnCheckedChanged="chktelugu_CheckedChanged" />
</ContentTemplate>
</asp:UpdatePanel>
</Content>
c# code:
protected void chktelugu_CheckedChanged(object sender, EventArgs e)
{
if (chktelugu.Checked == true)
{
Page.ClientScript.RegisterStartupScript(GetType(), "EnableTransalationTelugu", "EnableTransalationTelugu()", true);
}
}
像这样保持在更新面板中时,Java 脚本功能不会触发。如果在更新面板中有其他方法可以做到这一点,请指导我。它通过删除更新面板来工作。
谢谢