mercredi 1 octobre 2014

ExtJS 4 and ASP.Net - renderTo on MasterPage

Hello,

I have a problem with the renderTo property while using it with asp.net master pages, and my ext js code is on a separated file. The problem is that the panel do not render.


Extjs.js



Code:



var myPanel = Ext.create('Ext.TabPanel', {
renderTo: 'myDivId',
...
});

home.aspx


Code:



<asp:Content ID="Content2" ContentPlaceHolderID="cphHeader" runat="server">
<script type="text/javascript" src="Extjs.js"></script>
</asp:Content>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="myDivId">
</div>
</asp:Content>

If i use like this, don't work but if put my all the javascript code inside the script tag on the aspx file, works just fine.

Code:



<script type="text/javascript">
var myPanel = Ext.create('Ext.TabPanel', {
renderTo: 'myDivId',
...
});
</script>

Someone knows this problem ? renderTo is not finding my DIV by the ID if the code is not on the same file, how can I resolve this ?

thanks






ExtJS 4 and ASP.Net - renderTo on MasterPage

Aucun commentaire:

Enregistrer un commentaire