Sharepoint application page and javascriptDear members<br/><br/>I had the following problem<br/><br/>I declared this jascript block on a application page as follows<br/><br/>&lt;script  language=&quot;javascript&quot;&gt;<br/>    function Valida()<br/>    {<br/>     var panel = document.getElementById('pnlWorkflowInfraEstruturaOrgaoRH');<br/><br/>     if(panel.style.visibility = 'visible')<br/>    {<br/>         alert('panel visible');<br/>         return false;<br/>    }<br/>    else<br/>    {<br/>         alert('panel not visible');<br/>         return false;<br/>     }<br/><br/>  <br/>     return true;<br/>    }<br/>&lt;/script&gt;<br/><br/>&lt;asp:ImageButton ID=&quot;btnEnviar&quot; OnClientClick=&quot;return Valida();&quot; OnClick=&quot;btnEnviar_Click&quot; CssClass=&quot;mt10 fr&quot; runat=&quot;server&quot; ImageUrl=&quot;/_layouts/images/Redecard/btn_enviar.gif&quot; /&gt;<br/><br/><br/>The function is not working and the error shows that the variable &quot;panel&quot; declared in the function is not and it´s not picking the panel ID. I would like to know why??<br/><br/>Regards<br/><br/>Rodolfo<br/><hr class="sig">rsoares© 2009 Microsoft Corporation. All rights reserved.Fri, 17 Jul 2009 09:38:07 Zbfd823f0-534a-41a9-b3ef-26fc4191c22bhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#bfd823f0-534a-41a9-b3ef-26fc4191c22bhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#bfd823f0-534a-41a9-b3ef-26fc4191c22brsoareshttp://social.technet.microsoft.com/Profile/en-US/?user=rsoaresSharepoint application page and javascriptDear members<br/><br/>I had the following problem<br/><br/>I declared this jascript block on a application page as follows<br/><br/>&lt;script  language=&quot;javascript&quot;&gt;<br/>    function Valida()<br/>    {<br/>     var panel = document.getElementById('pnlWorkflowInfraEstruturaOrgaoRH');<br/><br/>     if(panel.style.visibility = 'visible')<br/>    {<br/>         alert('panel visible');<br/>         return false;<br/>    }<br/>    else<br/>    {<br/>         alert('panel not visible');<br/>         return false;<br/>     }<br/><br/>  <br/>     return true;<br/>    }<br/>&lt;/script&gt;<br/><br/>&lt;asp:ImageButton ID=&quot;btnEnviar&quot; OnClientClick=&quot;return Valida();&quot; OnClick=&quot;btnEnviar_Click&quot; CssClass=&quot;mt10 fr&quot; runat=&quot;server&quot; ImageUrl=&quot;/_layouts/images/Redecard/btn_enviar.gif&quot; /&gt;<br/><br/><br/>The function is not working and the error shows that the variable &quot;panel&quot; declared in the function is not and it´s not picking the panel ID. I would like to know why??<br/><br/>Regards<br/><br/>Rodolfo<br/><hr class="sig">rsoaresFri, 03 Jul 2009 15:08:32 Z2009-07-03T15:08:32Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#9e401b3b-f2b9-4b8d-bb09-5f1e74d0d9d7http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#9e401b3b-f2b9-4b8d-bb09-5f1e74d0d9d7Dave Hunterhttp://social.technet.microsoft.com/Profile/en-US/?user=Dave%20HunterSharepoint application page and javascriptCan you include the markup for the panel?<hr class="sig">My SharePoint Blog - <a href="http://www.davehunter.co.uk/blog">http://www.davehunter.co.uk/blog</a>Fri, 03 Jul 2009 15:13:42 Z2009-07-03T15:13:42Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#86d5e80a-79e1-4fe2-a89d-914fc196a7cehttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#86d5e80a-79e1-4fe2-a89d-914fc196a7cersoareshttp://social.technet.microsoft.com/Profile/en-US/?user=rsoaresSharepoint application page and javascriptHere´s the markup for the panel<br/><br/>&lt;asp:Panel ID=&quot;pnlWorkflowInfraEstruturaOrgaoRH&quot; runat=&quot;server&quot;&gt;<br/>        &lt;div class=&quot;box_padrao box02 bx_not mt10&quot;&gt;<br/>            &lt;div class=&quot;head_out&quot;&gt;&lt;div class=&quot;head_in&quot;&gt;&lt;/div&gt;&lt;/div&gt;<br/>            &lt;div class=&quot;bod_out&quot;&gt;<br/>                &lt;div class=&quot;bod_in overflow&quot;&gt;<br/>                &lt;h5 class=&quot;ca&quot;&gt;Aprovações:&lt;/h5&gt;              <br/>                    &lt;div&gt;<br/>                        &lt;table cellpadding=&quot;0&quot; cellspacing=&quot;10&quot; class=&quot;destinatario&quot;&gt;<br/>                            &lt;tr&gt;<br/>                                &lt;td class=&quot;bb0 tl&quot;&gt;&lt;b&gt;Gestor responsável (alçada mínima gerente):&lt;/b&gt;&lt;/td&gt;<br/>                            &lt;/tr&gt;<br/>                            &lt;tr&gt;<br/>                                &lt;td class=&quot;bb0&quot;&gt;<br/>                                &lt;tesla:ListSelector runat=&quot;server&quot; ID=&quot;lselGestorAprovacao&quot; CssClass=&quot;ListSelector1&quot; ResultColumnCodeText=&quot;Funcional&quot; ResultColumnValueText=&quot;Nome&quot; earchBoxFieldText=&quot;Nome:&quot; SearchBoxTitle=&quot;Selecione um funcionário&quot; /&gt;<br/>                                &lt;/td&gt;<br/>                            &lt;/tr&gt;<br/>                        &lt;/table&gt;<br/>                    &lt;/div&gt;                    <br/>                &lt;/div&gt;<br/>            &lt;/div&gt;<br/>            &lt;div class=&quot;fot_out&quot;&gt;&lt;div class=&quot;fot_in&quot;&gt;&lt;/div&gt;&lt;/div&gt;<br/>        &lt;/div&gt;<br/>        &lt;/asp:Panel&gt;<hr class="sig">rsoaresFri, 03 Jul 2009 15:25:12 Z2009-07-03T15:25:12Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#8dece6d7-67ee-4ae1-a779-ec3dfd5bc94fhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#8dece6d7-67ee-4ae1-a779-ec3dfd5bc94fRaghavanShttp://social.technet.microsoft.com/Profile/en-US/?user=RaghavanSSharepoint application page and javascriptHi,<br/><br/>After rendering the control's client ID might be different, hence the Javascript is not able to find it.<br/><br/>In the page that you have the panel, open in the browser and do a &quot;View Source&quot;. Get to know the ID of the panel element now. Give this id in the Javascript<br/><br/>var panel = document.getElementById('<em>ID from the view source</em>');<br/><br/><br/>Place the debugger in the javascript / put alerts to check if the javascript is able to find the panel<br/><br/>hope this helps<hr class="sig">RaghavanFri, 03 Jul 2009 17:33:42 Z2009-07-03T17:33:42Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#528f132d-3d19-413e-bb08-6daff25b210fhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#528f132d-3d19-413e-bb08-6daff25b210fArup Rhttp://social.technet.microsoft.com/Profile/en-US/?user=Arup%20RSharepoint application page and javascriptHi, <div>See after rendering server side control's id has changed so you will not get such way.</div> <div><br/></div> <div>try like this:</div> <div>option1:  </div> <div><br/></div> <div>var panel = document.getElementById(&quot;&lt;%= pnlWorkflowInfraEstruturaOrgaoRH.ClientID %&gt;&quot;);  //recommended and best way</div> <div><br/></div> <div>or </div> <div>option2:</div> <div><br/></div> <div>go to view source of that page and find this panel and copy the id value and </div> <div>var panel = document.getElementById(&quot;hard coded id value&quot;);   //not recommended</div> <div><br/></div> <div>feel free to ask more...</div><hr class="sig">--- Arup R(MCTS) Success does not Matter.Fri, 03 Jul 2009 18:53:23 Z2009-07-03T18:53:23Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#e5d47076-5528-4b35-a4a6-c830042d157dhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#e5d47076-5528-4b35-a4a6-c830042d157drsoareshttp://social.technet.microsoft.com/Profile/en-US/?user=rsoaresSharepoint application page and javascript<p>Good morning Arup<br/><br/>I did this<br/><br/>var panel = document.getElementById('&lt;% pnlWorkflowInfraEstruturaOrgaoRH.ClientID %&gt;');<br/>        <br/>        if(panel != null)<br/>        {<br/>            alert('pegou ID');<br/>            return false;<br/>        }<br/>        else<br/>        {<br/>            alert('Não pegou ID');<br/>            return false;<br/>        }<br/><br/>then I build my project and I deployed the solution<br/><br/>I get this error<br/><br/> <table class=ms-propertysheet border=0 cellspacing=0 cellpadding=0 width="100%"> <tbody> <tr valign=top> <td class=ms-descriptiontext width="100%"> </td> <td width=10><img src="http://social.msdn.microsoft.com/_layouts/images/blank.gif" alt="" width=10 height=1></td> </tr> <tr> <td height=8><img src="http://social.msdn.microsoft.com/_layouts/images/blank.gif" alt="" width=1 height=8></td> </tr> <tr> <td height="100%" valign=top><a name=mainContent></a> <table class=ms-titleareaframe border=0 cellpadding=0 width="100%"> <tbody> <tr> <td class=ms-descriptiontext style="padding-top:10px" width="100%" valign=top><span>C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\template\layouts\RedecardAppPages\Intranet\SolicitacaoToken.aspx(34): error BC30545: Property access must assign to the property or use its value.   at System.Web.Compilation.AssemblyBuilder.Compile() <br/>   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() <br/>   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) <br/>   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) <br/>   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) <br/>   at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) <br/>   at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) <br/>   at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) <br/>   at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) <br/>   at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) <br/>   at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute</span></td> </tr> </tbody> </table> <br/></td> </tr> </tbody> </table> <br/>Once I remove the javascript declarion. My application page works as normal..any thoughts<br/><br/>Regards<br/><br/>Rodolfo</p><hr class="sig">rsoaresMon, 06 Jul 2009 13:11:51 Z2009-07-06T13:11:51Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#6a2e7dc3-7f4b-4da7-aa96-6993826aebb0http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#6a2e7dc3-7f4b-4da7-aa96-6993826aebb0rsoareshttp://social.technet.microsoft.com/Profile/en-US/?user=rsoaresSharepoint application page and javascriptHi Arup<br/><br/>I eventually found out the problem<br/><br/>using option 2 because all controls are inside the content place holder &quot;PlaceHolderMain&quot;<br/><br/>var panel = document.getElementById('ctl00_PlaceHolderMain_pnlWorkflowInfraEstruturaOrgaoRH');<br/><br/>Is there any workaround to use option 1 in this scenario<br/><br/>Regards<br/><br/>Rodolfo<hr class="sig">rsoaresMon, 06 Jul 2009 14:18:51 Z2009-07-06T14:18:51Zhttp://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#efebead3-0f9d-4f22-86b4-303eef6b5629http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bfd823f0-534a-41a9-b3ef-26fc4191c22b#efebead3-0f9d-4f22-86b4-303eef6b5629Arup Rhttp://social.technet.microsoft.com/Profile/en-US/?user=Arup%20RSharepoint application page and javascriptHi,<br/>I can explain it better if you let me know the details about what are you tryin to do?<br/><br/>If you place panel directly inside sharepoint page by designer then you can not use option 1. if you develop your own webpart or user control then positively you can use option 1 and then it will work also.<br/><br/><br/><hr class="sig">--- Arup R(MCTS) Success does not Matter.Tue, 07 Jul 2009 10:50:00 Z2009-07-07T10:50:00Z