i am using this AjaxHtmlEditor Extender in one of my page, everything is fine Except in two cases.
1. First what i want to do is when we edit the saved data with html editor , i am restricting the user to edit in some of the cases for that i want to know how to make data only viewable in preview mode or how can we make it disabled.
2. I am restricting the user from copying any data from outside like word, notepad or any where (but i am able to achieve it partially because copying and pasting is not working in all browsers except Firefox(windows only) )
Javascript Code i am using for 2nd case is:
if ($get('ctl00_MainContent_htmlGen_ctl02_ctl00').contentWindow.document.body != null) {
$get('ctl00_MainContent_htmlGen_ctl02_ctl00').contentWindow.document.body.ondragover = function () {
return false;
};
$get('ctl00_MainContent_htmlGen_ctl02_ctl00').contentWindow.document.body.ondrop = function () {
please i need help on this i have tried everything as far as my knowledge is concern but i didn't get the solution , still i m not able to restrict copy paste in all browser .
can anyone help me with how to stop user from copy paste in Ajax Htmleditor extender ?
sam.kumar
Member
62 Points
46 Posts
Ajax HtmlEditor Extender: 2 Problems
Apr 13, 2012 06:57 AM|LINK
Dear all .Net guys,
i am using this AjaxHtmlEditor Extender in one of my page, everything is fine Except in two cases.
1. First what i want to do is when we edit the saved data with html editor , i am restricting the user to edit in some of the cases for that i want to know how to make data only viewable in preview mode or how can we make it disabled.
2. I am restricting the user from copying any data from outside like word, notepad or any where (but i am able to achieve it partially because copying and pasting is not working in all browsers except Firefox(windows only) )
Javascript Code i am using for 2nd case is:
if ($get('ctl00_MainContent_htmlGen_ctl02_ctl00').contentWindow.document.body != null) {
$get('ctl00_MainContent_htmlGen_ctl02_ctl00').contentWindow.document.body.ondragover = function () {
return false;
};
$get('ctl00_MainContent_htmlGen_ctl02_ctl00').contentWindow.document.body.ondrop = function () {
return false;
};
$get('ctl00_MainContent_htmlGen_ctl02_ctl00').contentWindow.document.body.onpaste = function () {
return false;
};
}
Song-Tian - ...
All-Star
43699 Points
4304 Posts
Microsoft
Re: Ajax HtmlEditor Extender: 2 Problems
Apr 16, 2012 05:37 AM|LINK
Hi,
Please refer to: http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/HTMLEditor/HTMLEditor.aspx and http://www.asp.net/ajaxlibrary/act_HTMLEditor.ashx.
Feedback to us
Develop and promote your apps in Windows Store
chetan.sarod...
All-Star
65739 Points
11138 Posts
Re: Ajax HtmlEditor Extender: 2 Problems
Apr 17, 2012 03:27 AM|LINK
Do the following in client-side:
// to prevent formatted text pasting $find("<%= myEditor.ClientID %>").get_editPanel().set_noPaste(true);Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
sam.kumar
Member
62 Points
46 Posts
Re: Ajax HtmlEditor Extender: 2 Problems
Apr 22, 2012 08:37 AM|LINK
hey chetan thanks for your time but i have alredy tried this .... and it is of no use...
can you have any other thing to share...
sam.kumar
Member
62 Points
46 Posts
Re: Ajax HtmlEditor Extender: 2 Problems
May 03, 2012 05:44 AM|LINK
Hey guys ....
please i need help on this i have tried everything as far as my knowledge is concern but i didn't get the solution , still i m not able to restrict copy paste in all browser .
can anyone help me with how to stop user from copy paste in Ajax Htmleditor extender ?
Thanks in advance.