473,396 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

<Object> & Custom server control

Hi everyone.

I don't know why but on the outputed page the dialog helper id is not recognized or is "undefined" Can someone tell suggest what I am doing wrong? I've been going over this goodness knows how many times and I can't figure it out. The Object is set on the page properly but is not recognized in the javascript. Some one please help.

Below is the code.

Thank you in advance,

Sam I am-

protected override void OnLoad(EventArgs e)

{

base.OnLoad (e);

if(!Page.IsClientScriptBlockRegistered("startup"))

{

StringBuilder jsload=new StringBuilder();

jsload.Append(@"<script language='javascript' type='text/javascript'>" + "\n");

jsload.Append(@"window.onload=doInit;" + "\n");

jsload.Append(@"function doInit()" + "\n");

jsload.Append(@"{" + "\n");

jsload.Append("\t" + @"for(i=0;i<document.all.length;i++)" + "\n");

jsload.Append("\t\t" + @"document.all(i).unselectable = 'on';" + "\n");

jsload.Append("\t\t" + @"oDiv.unselectable = 'off';" + "\n");

jsload.Append("\t\t" + @"oDiv.innerHTML='';" +"\n");

jsload.Append("\t\t" + @"oDiv.focus();" + "\n");

jsload.Append("\t\t" + @"getSystemFonts();" + "\n");

jsload.Append(@"}" + "\n");

jsload.Append(@"function callFormating(sformatString)" + "\n" + "{" + "\n");

jsload.Append("\t" + @"document.execCommand(sformatString);" + "\n");

jsload.Append(@"}" + "\n");

jsload.Append(@"function moveCurser(" + this.UniqueID + ")" + "\n" + "{" + "\n");

jsload.Append("\t" + @"var i;" + "\n");

jsload.Append("\t" + @"i=document.getElementById('oDiv');" + "\n");

jsload.Append("\t" + this.UniqueID + @".value=i.innerHTML;" + "\n");

jsload.Append(@"}" + "\n");

This the problem javascript:

jsload.Append(@"function getSystemFonts()" + "\n" + "{" + "\n");

jsload.Append("\t" + @"var a=dlgHelper.fonts.count;" + "\n");

jsload.Append("\t" + @"var fArray=new fArray();" + "\n");

jsload.Append("\t" + @"var oDropDown=document.getElementByID(oToolbar1).creat eDropDownListAt('1');" + "\n");

jsload.Append("\t" + @"oDropDown.setAttribute('ID','FontNameList');" + "\n");

jsload.Append("\t" + @"for(i=1;i<dlgHelper.fonts.count;i++)" + "\n" + "\t" + "{" + "\n");

jsload.Append("\t\t" + @"fArray[i] = dlgHelper.fonts(i);" + "\n");

jsload.Append("\t\t" + @"var aOptions = oDropDown.getOptions();" + "\n");

jsload.Append("\t\t" + @"var oOption = document.createElement('OPTION');" + "\n");

jsload.Append("\t\t" + @"aOptions.add(oOption);" + "\n");

jsload.Append("\t\t" + @"oOption.text = fArray[i];" + "\n");

jsload.Append("\t\t" + @"oOption.Value = i;" + "\n" + "\t" + "}" + "\n");

jsload.Append("\t" + @"oDropDown.setAttribute('onchange',ChangeFormat); " + "\n" + "}" + "\n");

jsload.Append(@"function ChangeFormat()" + "\n" + "{" + "\n");

jsload.Append("\t" + @"var sSelected2=document.getElementById(FontNameList);" + "\n");

jsload.Append("\t" + @"var sSelected3=sSelected2.Options(sSelected2.selectedI ndex);" + "\n");

jsload.Append("\t" + @"document.execCommand('FontName',false,sSelected3 .text);" + "\n");

jsload.Append("}" + "\n");

jsload.Append(@"function changeFontSize(strid)" + "\n" + "{" + "\n");

jsload.Append("\t" + @"var sSelected1=document.getElementById(strid);" + "\n");

jsload.Append("\t" + @"var sSelected=sSelected1.options(sSelected1.selectedIn dex);" + "\n");

jsload.Append("\t" + @"document.execCommand('FontSize',false,sSelected. value);" + "\n");

jsload.Append(@"}" + "\n");

jsload.Append(@"</script>" + "\n");
string CMSUpReg=jsload.ToString();

Page.RegisterClientScriptBlock("Startup",CMSUpReg) ;

}

}

This is the where the object is rendered

protected override void OnPreRender(EventArgs e)

{

base.OnPreRender (e);

if(!Page.IsClientScriptBlockRegistered("jObject"))

{

StringBuilder jsObject=new StringBuilder();

jsObject.Append(@"<Object id='dlgHelper' CLASSID='clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b' Width='0' Height='0'></Object>" + "\n");

string strjsObject=jsObject.ToString();

Page.RegisterClientScriptBlock("jObject",strjsObje ct);

}

}

Nov 19 '05 #1
0 977

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Wolfgang Schwanke | last post by:
Dear usenet, I'm having the following small problem. I've been ask to add some Quicktime panoramas to a website. The author of the panoramas has made two versions of each: One in MOV format,...
6
by: Christopher Benson-Manica | last post by:
(I posted this as a reply to my thread about iframes, but I think it may get mostly ignored there.) http://ataru.gomen.org/files/test.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"...
4
by: KC | last post by:
Could some one explain to me the casting rules for sending generic lists, ex. List<Person>, to a function that accepts List<object>? I cannot get the following easy-cheesy app to work. I get the...
2
by: Alex Maghen | last post by:
I want to insert (or not insert) a Macromedia Flash object on my ASP.NET .ASPX page. What is the most elegant way of doing this? I know that I could use an <ASP:Literal> control and just spit the...
0
by: Sam Samnah | last post by:
Hi everyone. I don't know why but on the outputed page the dialog helper id is not recognized or is "undefined" Can someone tell suggest what I am doing wrong? I've been going over this...
2
by: Martin Eyles | last post by:
Hi, I want to have an <objecttag in my .aspx file, so that it is shown as part of my webpage. I want to add data to the "data" attribute using server side code, so I thought I would add the...
4
by: msnews.microsoft.com | last post by:
hello every one i am using media player in internet explorer but i cannot access it directly in code behind, so do you know a way to access it? <object id="video123"...
3
by: Brad | last post by:
I have several movies being presented to the web on a single page and each one is dependant on a link selected. On the .aspx page I have the following code for a single movie. ...
5
by: mark4asp | last post by:
According to this <http://css-discuss.incutio.com/?page=BoxModelHack> IE6 will display differently to the W3C standard. Only IE6/strict and I suppose IE 7 display correctly. IE 6 transitional and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.