473,406 Members | 2,369 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,406 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 979

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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.