Hỏi đáp
Chia sẻ kiến thức, cùng nhau phát triển
các pro cho mình hỏi, mình có 1 đoạn code sau :
trong cs :
Khi lấy giá trị của Ckeditor luôn trả về rỗng nếu đặt trong Update Panel. Bỏ Update Panel đi thì lấy được :(
các pro cho mình hỏi, mình có 1 đoạn code sau :
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="txtCkEditor" TextMode="MultiLine" runat="server" Width="100%" Height="300px"></asp:TextBox>
<script>
CKEDITOR.replace('<%=txtCkEditor.ClientID%>', {});
</script>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
12345678910
trong cs :
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string Value = txtCkEditor.Text; // luôn trả về rỗng nếu đặt trong Update Panel
}
1234567891011
Khi lấy giá trị của Ckeditor luôn trả về rỗng nếu đặt trong Update Panel. Bỏ Update Panel đi thì lấy được :(
Để sử dụng tính năng này, Bạn cần đăng nhập bằng tài khoản Howkteam.
Đăng nhập
Để xem được nội dung và giúp Kteam duy trì hoạt động.
Bạn vui lòng tắt Adblock trên website howkteam.vn nhé!
Bạn thêm Name = "txtCkEditor" thử xem