为什么作为ATLAS的UpdatePanel局部刷新的触发按钮在提交的情况下获得控件输入编码会不正确?

Mr.Osc 2006-07-09 08:32:39
为什么作为ATLAS的UpdatePanel局部刷新的触发按钮在提交的情况下获得控件输入编码会不正确?

配置文件中:
<globalization requestEncoding="gb2312" responseEncoding="gb2312"/>

a.aspx中:
<%@ Page Language="C#" CodeFile="a.aspx.cs" Inherits="a" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server" />
</head>
<body><form runat="server">
<asp:TextBox ID="textbox1" CssClass="css1" TabIndex="6" runat="server" />
<asp:Button ID="button1" CssClass="css2" Text="查询" runat="server" OnClick="button1_Click" />
<atlas:UpdatePanel ID="up1" Mode="Conditional" RenderMode="Block" runat="server">
<ContentTemplate>
<div class="css3">
<asp:RadioButtonList ID="radiolist1" RepeatColumns="4" Visible="true" runat="server">
<asp:ListItem />
</asp:RadioButtonList>
</div>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="button1" EventName="Click" />
</Triggers>
</atlas:UpdatePanel>
</form></body>

环境:XP+VS2005
...全文
393 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
greki 2006-09-12
  • 打赏
  • 举报
回复
记号
Mr.Osc 2006-07-10
  • 打赏
  • 举报
回复
嗯呢,多谢思归,我把WEB.CONFIG中的配置设置成<globalization requestEncoding="utf-8" responseEncoding="utf-8" />就行了,在互联网上听人说ATLAS目前好像还不支持GB2312。

结帖了。。。
saucer 2006-07-09
  • 打赏
  • 举报
回复
try to use UTF-8 instead (that means you might need re-save all your files in UTF-8), otherwise, you need to hack the atlas' javascript to encode your text into something compatible with GB2312, see

http://alonglee.net/tech/News_details.asp?news_ID=2087&user_ID=10
Mr.Osc 2006-07-09
  • 打赏
  • 举报
回复
在button1_Click方法中获取textbox1.Text,当值为中文时就出现了编码错误。但是如果是其它按钮导致的页面提交控件中的输入就没有这个问题。
wawowawoo 2006-07-09
  • 打赏
  • 举报
回复
ding

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧