Using DesignMode in ASP.NET

  • Thread starter Thread starter Marcel Balcarek
  • Start date Start date
M

Marcel Balcarek

I have an IFrame control defined. Is there a way to turn designMode on for
it, so that I can edit text in it using richtext capabilities?

These IFrame controls awill be defined dynamically in code behind . .

Ideally, I would want the solution to work in Netscape too ...

Any part of the solution would be helpful.

Thank you
Marcel
 
1) Part of the solution: In Javascript I can do this: ( per
http://devedge.netscape.com/viewsource/2003/midas/01/ )

Figure 3 : Setting up rich-text editing
HTML:
<body onload="load()">

JavaScript:
function load(){
getIFrameDocument("editorWindow").designMode = "On";
}

function getIFrameDocument(aID){
// if contentDocument exists, W3C compliant (Mozilla)
if (document.getElementById(aID).contentDocument){
return document.getElementById(aID).contentDocument;
} else {
// IE
return document.frames[aID].document;
}
}

2) Now add Javascript attributes to the window load - something like this -
I still need to work it out

myWindow.Attributes.Add("onload", "javascript:load(Pass in each iframe id)")

myWindow.Attributes.Add("onload", "javascript:load(Pass in each iframe id)")

That might do it ...
 
Back
Top