| Home | Forums | Reviews | Guides | Newsgroups | Register | Search |
![]() |
| Thread Tools |
| Bob |
|
|
|
| |
|
Bob
Guest
Posts: n/a
|
I have confirmed that there is a bug in the WebControls
TreeView, at least the way I am using it. I add it to a User Control, and then the User Control is added to the web page placeholder via LoadControl(). It causes the syntax error in IE during the __doPostBack javascript call, effectively nulling any post backs, which eliminates any event handlers such as Expand etc. The code below was taken from the "View Source" option in IE when the error occurred. I placed it in my UserControl HTML and modified the line theform = document._ctl9:form1; to be theform = document.forms["_ctl9:form1"]; All the TreeView events started posting back to the server and calling the correct event handlers. Now if I could only find the place in the TreeView source to fix it(if the code is not in a System base class like Page), I would be very happy. I know the WebControls are not supported by MS, but if anyone can point me to the correct location in TreeView source, I would appreciate it. The offending javascript, modified to work: function __doPostBack(eventTarget, eventArgument) { var theform; if (window.navigator.appName.toLowerCase().indexOf ("netscape") > -1) { theform = document.forms["_ctl9:form1"]; } else { //theform = document._ctl9:form1; theform = document.forms["_ctl9:form1"]; } theform.__EVENTTARGET.value = eventTarget.split("$").join (":"); theform.__EVENTARGUMENT.value = eventArgument; theform.submit(); } // --> >-----Original Message----- >I put a Treeview WebControl on a User Control and then >put the User Control on a web page. The first time I try >to click the Treeview (expand a node) Internet Explore >gets an "Error on page". When I look at the error it says >that ';' was expected at line 82,column 28. This is the >line: > theform = document._ctl9:form1; > >Column 28 is the ':'. This syntax does not look correct >to me. Does anyone know how to fix this. I have looked at >the Treeview source but cannot find the exact location >where the javascript:__doPostback() is emitted. I think >it may be in the IPostbackEvent class. >Below is the entire source shown when the error occurs. >The line is part of testing for browser type and getting >the form object like this in the emitted __doPostback >javascript function: > > var theform; > if (window.navigator.appName.toLowerCase().indexOf >("netscape") > -1) { > theform = document.forms["_ctl9:form1"]; > } > else { > theform = document._ctl9:form1; > } > > >Any help would be appreciated. >Thanks. > > ><HTML><HEAD><title>MyOne:MyWare Tester</title><meta >name="GENERATOR" Content="Microsoft Visual Studio >7.0"><meta name="CODE_LANGUAGE" Content="C#"><meta >name="vs_defaultClientScript" content="JavaScript"><meta >name="vs_targetSchema" >content="http://schemas.microsoft.com/intellisense/ie5">< L >INK href="./css/h1rm.css" type="text/css" >rel="stylesheet"></HEAD><body leftmargin="0" >rightmargin="0" marginwidth="0" width="100%" >bgColor="#6699ff" MS_POSITIONING="GridLayout" >onload="ExecJavascript();"><table style="Z-INDEX: 103; >LEFT: 0px; POSITION: absolute; TOP: 0px" border="1" >cellSpacing="0" cellPadding="0" width="100%" >bgColor="#00066"><tr><td align="left" width="10"><IMG >height="85" src="../images/MyLogo.gif" width="150" >border="0" name="Logo"></td><td><table >bgColor="gainsboro" bordercolor="gainsboro" >bordercolordark="gainsboro" bordercolorlight="gainsboro" >border="border" width="100%" ID="Table2"><tr><td >align="middle" class="ln_Head" nowrap>MyOne Report >Maintenance</td></tr><tr><td align="middle" >class="ln_Head" nowrap>MyWare Tester</td></tr><tr><td >align="right" nowrap><a class="ln_text" >href="#">Home</a><IMG height="0" >src="../images/spacer.gif" width="12"><a class="ln_text" >href="#"></a><IMG height="0" src="../images/spacer.gif" >width="12"><a class="ln_text" href=javascript:f_openHelp >();>Help</a><IMG height="0" src="../images/spacer.gif" >width="12"></td></tr></table></td></tr><table style="Z- >INDEX: 103; LEFT: 0px; POSITION: absolute; TOP: 86px" >border="1" cellSpacing="0" cellPadding="0" width="100%" >height=90% bgColor="#6699ff"><tr><td align='center' >valign='top'> ><script language="JavaScript"> >function f_openHelp(){ > // set window options > sWindow >= "height=300,left=100,top=100,width=400,location=no ,menu b >ar=no,resizable=yes,scrollbars=yes,status=no,titl ebar=yes , >toolbar=no"; > // open window > winLG = window.open("HWTesterHelp.htm", "winLG", >sWindow, true); > // set focus on the window > winLG.focus(); >} ></script> ><DIV style="WIDTH: 694px; POSITION: relative; HEIGHT: >541px" ms_positioning="GridLayout"> > <form name="_ctl9:form1" method="post" >action="HWTester.aspx" id="_ctl9_form1"> ><input type="hidden" name="___ctl9_TreeView1_State__" >value="" /> ><input type="hidden" name="__VIEWSTATE" >value="dDw1MzgxO3Q8O2w8aTwxNj47PjtsPHQ8O2w8aTwwPj s+O2w8dD w >7bDxpPDE+Oz47bDx0PDtsPGk8Nz47aTw1MT47PjtsPHQ8cDxw PGw8VGV4 d >DtWaXNpYmxlOz47bDxcZTtvPGY+Oz4+Oz47Oz47dDxAMDxwPH A8bDxTZW x >lY3RlZE5vZGVJbmRleDs+O2w8MDs+Pjs+Ozs7OztAMDw7QDA8 bDxpPDA+ O >z47bDxAMDxAMDxwPGw8U2VsZWN0ZWQ7PjtsPG88dD47Pj47Oz s7Pjs7Pj s >+Oz47Pjs+Ozs+Oz4+Oz4+Oz4+Oz4+O2w8X2N0bDk6VHJlZVZp ZXcxOz4+ B >Q/n2CZnpO49HoKjySX2zWAOb/c=" /> > > <span id="_ctl9_lblSqlTest" >style="color:Black;width:432px;Z-INDEX: 101; LEFT: 20px; >POSITION: absolute; TOP: 22px">TEST SQL: Press Load or >Clear button to load/clear DropDownList</span><input >type="submit" name="_ctl9:btnLoad" value="Load" >id="_ctl9_btnLoad" style="width:109px;Z-INDEX: 102; LEFT: >362px; POSITION: absolute; TOP: 53px" /><select >name="_ctl9:ddlstSrchMgrID" id="_ctl9_ddlstSrchMgrID" >style="width:304px;Z-INDEX: 103; LEFT: 20px; POSITION: >absolute; TOP: 55px"> > ></select> > <input name="_ctl9:txtLogMsg" type="text" >id="_ctl9_txtLogMsg" style="width:375px;Z-INDEX: 104; >LEFT: 20px; POSITION: absolute; TOP: 135px" /> > > <input type="submit" name="_ctl9:btnFile" >value="LogFile" id="_ctl9_btnFile" style="Z-INDEX: 106; >LEFT: 426px; POSITION: absolute; TOP: 111px" /> > <input type="submit" name="_ctl9:btnDB" >value="LogDB" id="_ctl9_btnDB" style="Z-INDEX: 107; LEFT: >428px; POSITION: absolute; TOP: 147px" /> > <input type="submit" >name="_ctl9:btnEvent" value="LogEvent" >id="_ctl9_btnEvent" style="Z-INDEX: 108; LEFT: 508px; >POSITION: absolute; TOP: 112px" /> > <input type="submit" >name="_ctl9:btnEmail" value="LogEmail" >id="_ctl9_btnEmail" style="Z-INDEX: 109; LEFT: 510px; >POSITION: absolute; TOP: 147px" /> > <span id="_ctl9_lblLogTest" >style="width:493px;Z-INDEX: 110; LEFT: 23px; POSITION: >absolute; TOP: 89px">TEST LOG: Enter Msg Text and Config >Options and then press a Log Button</span> > <input type="submit" >name="_ctl9:btnClear" value="Clear" id="_ctl9_btnClear" >style="width:94px;Z-INDEX: 111; LEFT: 496px; POSITION: >absolute; TOP: 50px" /> > <input name="_ctl9:txtDBConnectString" >type="text" id="_ctl9_txtDBConnectString" >style="width:341px;Z-INDEX: 112; LEFT: 262px; POSITION: >absolute; TOP: 183px" /> > <input name="_ctl9:txtEmailAddress" >type="text" id="_ctl9_txtEmailAddress" >style="width:197px;Z-INDEX: 113; LEFT: 312px; POSITION: >absolute; TOP: 213px" /> > <span id="_ctl9_lblDB" >style="width:217px;Z-INDEX: 114; LEFT: 23px; POSITION: >absolute; TOP: 181px">Enter DB Connect String if >desired</span> > <span id="_ctl9_lblEmail" >style="width:272px;Z-INDEX: 115; LEFT: 23px; POSITION: >absolute; TOP: 212px">Enter email address for Email >(REQUIRED)</span> > <table id="_ctl9_rblOutput" border="0" >style="Z-INDEX: 116; LEFT: 44px; POSITION: absolute; TOP: >307px"> > <tr> > <td><input id="_ctl9_rblOutput_0" >type="radio" name="_ctl9:rblOutput" value="XML" /><label >for="_ctl9_rblOutput_0">XML</label></td><td><input >id="_ctl9_rblOutput_1" type="radio" >name="_ctl9:rblOutput" value="ASCII" /><label >for="_ctl9_rblOutput_1">ASCII</label></td> > </tr> ></table> > <span id="_ctl9_lblFileConfig" >style="width:267px;Z-INDEX: 117; LEFT: 24px; POSITION: >absolute; TOP: 245px">Select Disk Log File Configuration >options</span> > <span id="_ctl9_Label1" >style="width:44px;Z-INDEX: 118; LEFT: 43px; POSITION: >absolute; TOP: 280px">Folder</span> > <input name="_ctl9:txtFolder" type="text" >id="_ctl9_txtFolder" style="width:179px;Z-INDEX: 119; >LEFT: 116px; POSITION: absolute; TOP: 278px" /> > <span id="_ctl9_Label2" >style="width:57px;Z-INDEX: 120; LEFT: 325px; POSITION: >absolute; TOP: 281px">FileName</span> > <input name="_ctl9:txtFileName" >type="text" id="_ctl9_txtFileName" style="Z-INDEX: 121; >LEFT: 401px; POSITION: absolute; TOP: 280px" /> > <table id="_ctl9_rblType" border="0" >style="width:336px;Z-INDEX: 122; LEFT: 203px; POSITION: >absolute; TOP: 308px"> > <tr> > <td><input id="_ctl9_rblType_0" >type="radio" name="_ctl9:rblType" >value="MONTHLY" /><label >for="_ctl9_rblType_0">MONTHLY</label></td><td><input >id="_ctl9_rblType_1" type="radio" name="_ctl9:rblType" >value="DAILY" /><label >for="_ctl9_rblType_1">DAILY</label></td><td><input >id="_ctl9_rblType_2" type="radio" name="_ctl9:rblType" >value="NUMDAYS" /><label >for="_ctl9_rblType_2">NUMDAYS</label></td><td><input >id="_ctl9_rblType_3" type="radio" name="_ctl9:rblType" >value="BYSIZE" /><label >for="_ctl9_rblType_3">BYSIZE</label></td> > </tr> ></table> > <table id="_ctl9_rblTwoLine" border="0" >style="width:141px;Z-INDEX: 123; LEFT: 370px; POSITION: >absolute; TOP: 336px"> > <tr> > <td><input id="_ctl9_rblTwoLine_0" >type="radio" name="_ctl9:rblTwoLine" >value="TWOLINE" /><label >for="_ctl9_rblTwoLine_0">TWOLINE</label></td><td><input >id="_ctl9_rblTwoLine_1" type="radio" >name="_ctl9:rblTwoLine" value="ONELINE" /><label >for="_ctl9_rblTwoLine_1">ONELINE</label></td> > </tr> ></table> > <span id="_ctl9_Label3" >style="width:123px;Z-INDEX: 124; LEFT: 49px; POSITION: >absolute; TOP: 339px">FileSize(if BYSIZE)</span> > <input name="_ctl9:txtBySize" type="text" >maxlength="5" id="_ctl9_txtBySize" style="Z-INDEX: 125; >LEFT: 186px; POSITION: absolute; TOP: 339px" /> > <span id="_ctl9_Label4" >style="height:13px;width:118px;Z-INDEX: 126; LEFT: 563px; >POSITION: absolute; TOP: 11px">Click Help also ^</span> > <?XML:NAMESPACE PREFIX=TVNS /> ><?IMPORT NAMESPACE=TVNS >IMPLEMENTATION="/webctrl_client/1_0/treeview.htc" /> ><tvns:treeview id="_ctl9_TreeView1" selectedNodeIndex="0" >HelperID="___ctl9_TreeView1_State__" >systemImagesPath="/webctrl_client/1_0/treeimages/" >autoSelect="true" onexpand="javascript: if >(this.clickedNodeIndex != null) this.queueEvent >('onexpand', this.clickedNodeIndex)" >oncollapse="javascript: if (this.clickedNodeIndex != >null) this.queueEvent('oncollapse', >this.clickedNodeIndex)" oncheck="javascript: if >(this.clickedNodeIndex != null) this.queueEvent >('oncheck', this.clickedNodeIndex)" >onselectedindexchange="javascript: if >(event.oldTreeNodeIndex != event.newTreeNodeIndex) >this.queueEvent('onselectedindexchange', >event.oldTreeNodeIndex + ',' + event.newTreeNodeIndex)" >onfirequeuedevents="javascript: window.setTimeout >('__doPostBack(\'_ctl9$TreeView1\',\'\')', >0, 'JavaScript')" style="height:117px;Z-INDEX: 127; LEFT: >34px; POSITION: absolute; TOP: 404px"> > <tvns:treenode Selected="true"> > Node0<tvns:treenode> > Node1<tvns:treenode> > Node4 > </tvns:treenode><tvns:treenode> > Node5 > </tvns:treenode> > </tvns:treenode><tvns:treenode> > Node2 > </tvns:treenode><tvns:treenode> > Node3 > </tvns:treenode> > </tvns:treenode> ></tvns:treeview> ><input type="hidden" name="__EVENTTARGET" value="" /> ><input type="hidden" name="__EVENTARGUMENT" value="" /> ><script language="javascript"> ><!-- > function __doPostBack(eventTarget, eventArgument) >{ > var theform; > if (window.navigator.appName.toLowerCase >().indexOf("netscape") > -1) { > theform = document.forms >["_ctl9:form1"]; > } > else { > theform = document._ctl9:form1; > } > theform.__EVENTTARGET.value = >eventTarget.split("$").join(":"); > theform.__EVENTARGUMENT.value = >eventArgument; > theform.submit(); > } >// --> ></script> ></form> ></DIV> ></td></tr><tr><td align='center' height='20'><i>Copyright >2003 - MyWare, >Inc.</i></td></tr></table></table></body></HTML> >. > |
|
|
|
|
|||
|
|||
| Bob |
|
|
|
| |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Custom webcontrol that references another webcontrol | Fabricio | ASP .Net Building Controls | 0 | 09-21-2005 02:55 AM |
| Trapping an Exception ocurring in a Webcontrol at the Page or parent WebControl level. | ASP .Net | 2 | 01-31-2005 06:34 PM | |
| WebControl inside of WebControl and attaching events | Kasabaarde Sumta | ASP .Net Building Controls | 0 | 12-13-2004 09:51 PM |
| WebControl with non-WebControl property | Peter Morris [Air Software Ltd] | ASP .Net Web Controls | 1 | 12-07-2004 12:25 PM |
| Can a webcontrol (webcontrol.dll) have a configuration file? | Luis RamÃrez. | ASP .Net Building Controls | 2 | 07-06-2004 04:35 PM |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc..
SEO by vBSEO ©2010, Crawlability, Inc. |




