如何动态获取HTMLEditor控件的内容 [英] How to get dynamically HTMLEditor control Content

查看:180
本文介绍了如何动态获取HTMLEditor控件的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面中使用HTMLEditor,我动态创建了控件.我分配了ID.
用户输入内容,然后单击按钮我要保存在我的数据库中.我如何获取内容.请任何人帮助我.

我的代码是

I am using HTMLEditor in my page.I dynamically created the controls. I assign id.
User enter somthing and Clicking the button i want to save in my database. How can i get the content.Please anyone help me.

My Code is

Dim myEditor as AjaxControlToolkit.HTMLEditor.Editor 


myEditor= New AjaxControlToolkit.HTMLEditor.Editor 
myEditor.Id="myEditor1"
myEditor.content="hai..."

myEditor= New AjaxControlToolkit.HTMLEditor.Editor 
myEditor.Id="myEditor2"
myEditor.content="hai..somthing get from database."


Private Sub bt_Save_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bt_Save.Click

Dim ss As Object = Request.Form("myEditor1")
'i got always nothing

推荐答案

我假设您正在使用ASP.NET?您没有说,因此未正确标记.

如果动态创建控件,则无法在强类型化的代码后面获取它们的值.您需要自己使用Request.Content(从内存中)检查表单中的帖子数据,并查看其中是否存在.
I assume you''re using ASP.NET ? You didn''t say, so this is not tagged properly.

If you create controls dynamically, there''s no way to get their values in the code behind that''s strongly typed. You need to examine the post data in the form yourself with Request.Content ( from memory ) and see if it''s in there.


这篇关于如何动态获取HTMLEditor控件的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆