2015-02-07 31 views
0

我有一個土耳其字符串爲「Sitemizibeğeniyormusunuz?」。在餅乾Cookie chartset error page_load ASP.NET

我有一個網頁。 Survey.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Survey.aspx.vb" Inherits="Survey" Culture="tr-TR" UICulture="tr" %> 

<!DOCTYPE html> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9" /> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="tr"> 

<head runat="server"> 
<title></title> 
</head> 
<body> 
<form id="form1" runat="server"> 
<div> 
    <asp:Label ID="Label1" runat="server"></asp:Label> 
</div> 
</form> 
</body> 
</html> 

代碼文件:卷標=的Survey.aspx.vb

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load 
    Dim myCookie As HttpCookie = Request.Cookies("SurveyCookie") 
    If myCookie IsNot Nothing Then 
     Label1.Text = myCookie("Ask") 
    End If 
    End Sub 

當負載此頁第一次沒有任何問題

文本 「Sitemizibeğeniyormusunuz?」

但是當我加載第二時間或的Label1 =的更

文本 「Sitemizi BEA?eniyor musunuz?」

,當你找回他們,我已經設置的web.config

<system.web> 
<globalization requestEncoding="iso-8859-9" responseEncoding="iso-8859-9" culture="tr-TR" uiCulture="tr" fileEncoding="iso-8859-9" /> 
</system.web> 
+0

當你設置它們和URLDecoding當你檢索它們時,你嘗試過URLEncoding cookie嗎? – theduck 2015-02-07 19:42:50

+0

謝謝。是的,我現在嘗試和工作。但爲什麼這個問題? – 2015-02-07 21:38:02

+0

在下面的答案中增加了一個有用的鏈接。 – theduck 2015-02-07 21:47:30

回答