Click here to Skip to main content
16,012,198 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

VB
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
Posted
Updated 20-Jul-12 21:05pm
v3

1 solution

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.
 
Share this answer
 
Comments
godbrother3 21-Jul-12 3:13am    
it's not there.
Christian Graus 21-Jul-12 3:24am    
Then there's no way to get the data from dynamically created control, unless you use AJAX, which is nicer anyhow.
godbrother3 21-Jul-12 4:34am    
Thanks you..
godbrother3 21-Jul-12 4:34am    
But if i use textbox i get the text.
godbrother3 21-Jul-12 4:33am    
But if i use textbox i get the text.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900