如何在回发时将 JavaScript 值推送到服务器?
我只是在玩 ckeditor,但无法让这个该死的东西为我工作。我以某种方式需要在回发之前或同时“数据绑定”文本框。我该怎么做?
加载数据很好,但是当我单击更新时,我需要以某种方式检索文本框的新值。这并不像从服务器调用客户端来获取其中的内容那么容易,对吗?我需要客户推迟更改吗?
在动态数据中,有一种方法可以通过以下方法将控件的值绑定回实体:
protected override void ExtractValues(IOrderedDictionary dictionary)
{
dictionary[Column.Name] =
ConvertEditedValue(HttpUtility.HtmlEncode(CKEditor.Text));
}
现在该值始终相同,它是我最初绑定到 CKEditor 控件的值:
protected override void OnDataBinding(EventArgs e)
{
base.OnDataBinding(e);
if (FieldValue != null)
{
CKEditor.Text = HttpUtility.HtmlDecode(FieldValueEditString);
}
}
我该如何解决这个问题? :)
I was just playing around with ckeditor and can't get the darn thing to work for me. I somehow need to "data bind" the text box just before or at the same time of post back. How do I do that?
Loading the data is fine but when I click update I need to somehow retrieve the new value of the text box. It's not as easy as to call the client from the server to just get whatever is in there right? I need the client to push the changes back?
In dynamic data there is a method for binding the value of the control back to the entity in the following method:
protected override void ExtractValues(IOrderedDictionary dictionary)
{
dictionary[Column.Name] =
ConvertEditedValue(HttpUtility.HtmlEncode(CKEditor.Text));
}
Now that value is always the same it's the value I originally bound to my CKEditor control:
protected override void OnDataBinding(EventArgs e)
{
base.OnDataBinding(e);
if (FieldValue != null)
{
CKEditor.Text = HttpUtility.HtmlDecode(FieldValueEditString);
}
}
How do I solve this? :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回发后,检查快速监视窗口中的Request.Form对象,看看是否可以获取那里编辑器的数据。我可以保证编辑器数据可以在Request.Form对象中找到。然后就可以拿出来使用了!
After postback check the Request.Form object in quick watch window and see if you can get the data of the editor over there. I can guarantee that the editor data could be found in the Request.Form object. Then you can take it out and use it !