m*****h 发帖数: 18 | 1 I have a user control used to dynamically display web contents. To make the
web content editable in the browser I set the contenteditable= true in the <
div> tag.
when the uswer control is loaded, set div.innerhtml as the content returned
from the database. the problem i have right now is after editing the content
in the broswer, i can't get the new content. although i can get the new
value in the javascript, i need to save the new content to the database. so
i have to do it in the code behind. | c**t 发帖数: 2744 | 2 can't you use AJAX to post back?
the
<
returned
content
so
【在 m*****h 的大作中提到】![](/moin_static193/solenoid/img/up.png) : I have a user control used to dynamically display web contents. To make the : web content editable in the browser I set the contenteditable= true in the < : div> tag. : when the uswer control is loaded, set div.innerhtml as the content returned : from the database. the problem i have right now is after editing the content : in the broswer, i can't get the new content. although i can get the new : value in the javascript, i need to save the new content to the database. so : i have to do it in the code behind.
| k****i 发帖数: 1072 | 3 Make sure the viewstate is enabled and the timing you tried to retrieve the
new value.
the
<
returned
content
so
【在 m*****h 的大作中提到】![](/moin_static193/solenoid/img/up.png) : I have a user control used to dynamically display web contents. To make the : web content editable in the browser I set the contenteditable= true in the < : div> tag. : when the uswer control is loaded, set div.innerhtml as the content returned : from the database. the problem i have right now is after editing the content : in the broswer, i can't get the new content. although i can get the new : value in the javascript, i need to save the new content to the database. so : i have to do it in the code behind.
| g***y 发帖数: 27 | 4 throw a hidden text box onto the page. make it a server control, copy value
from editable div to this box using javascript (onkeyup event may work) as
user types. read values inside this hidden box from server side code. | m*****h 发帖数: 18 | |
|