Hi!
I've implemented some DropDown list in ASP.NET that use Ajax to fetch
the data from the server. The javascript is written to call cascading to
the bottom most dropdown in order to update them all if a top one changed.
The strange thing is that the script runs without problems on IE but in
FireFox i get a "too much recursion" error and nothing happens.
Here is the javascript code generated:
<script language="JavaS cript">
<!--
function _ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang() {
var value = document.getEle mentById( "_ctl12_cob_cli ent" ).value;
var para_0=2;
AjaxMethods.Get ChannelsByClien tByLang( value, para_0,
_ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang_callb ack );
}
function
_ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang_callb ack(
response ) {
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var reciever = document.getEle mentById("_ctl1 2_acob_channel" );
var viewStateElem =
document.getEle mentsByName("_c tl12_acob_chann el_VIEWSTATE")[0];
Fill_ListContro lFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )
_ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g()
} else {
alert("DataSet corrupted or no data");
}
}
function _ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g() {
var value = document.getEle mentById( "_ctl12_acob_ch annel" ).value;
var para_0=document .getElementById ("_ctl12_cob_cl ient").value;
var para_1=2;
AjaxMethods.Get CategoryByChann elClientLang( value, para_0, para_1,
_ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g_callback );
}
function
_ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g_callback(
response ) {
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var reciever = document.getEle mentById("_ctl1 2_acob_category ");
var viewStateElem =
document.getEle mentsByName("_c tl12_acob_categ ory_VIEWSTATE")[0];
Fill_ListContro lFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )
_ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language()
} else {
alert("DataSet corrupted or no data");
}
}
function
_ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language()
{
var value = document.getEle mentById( "_ctl12_acob_ca tegory" ).value;
var para_0=document .getElementById ("_ctl12_cob_cl ient").value;
var para_1=2;
AjaxMethods.Get SubCategoriesBy MainCat_Client_ Language( value, para_0,
para_1,
_ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language_c allback
);
}
function
_ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language_c allback(
response ) {
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var reciever = document.getEle mentById("_ctl1 2_acob_subcateg ory");
var viewStateElem =
document.getEle mentsByName("_c tl12_acob_subca tegory_VIEWSTAT E")[0];
Fill_ListContro lFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )
} else {
alert("DataSet corrupted or no data");
}
}
function Fill_ListContro lFromDataBase( ds, reciever, viewStateElem,
textFieldName, valueFieldName ) {
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var html = [];
var i=0;
while( reciever.childN odes.length > 0 ) {
var node = reciever.childN odes[0];
reciever.remove Child( node );
}
var vs = [];
for(i=0; i<ds.Tables[0].Rows.length; i++) {
var txt = ds.Tables[0].Rows[i][textFieldName];
var id = ds.Tables[0].Rows[i][valueFieldName]
vs[vs.length] = id + ":" + txt + "|";
var opt = document.create Element("option ");
var txt = document.create TextNode( txt );
var atr = document.create Attribute( "value" );
atr.nodeValue = id;
opt.setAttribut eNode( atr );
opt.appendChild ( txt );
reciever.append Child( opt );
}
if ( viewStateElem != null ) {
viewStateElem.v alue = vs.join("");
} else {
alert("No ViewStateFound" );
}
}
}
// -->
</script>
Each function on it's own works if i remove the calls for the child
value method.
Has anyone an idea how this can happen as there is no recursion in this
functions.
thanks in advance and greetings,
chris
I've implemented some DropDown list in ASP.NET that use Ajax to fetch
the data from the server. The javascript is written to call cascading to
the bottom most dropdown in order to update them all if a top one changed.
The strange thing is that the script runs without problems on IE but in
FireFox i get a "too much recursion" error and nothing happens.
Here is the javascript code generated:
<script language="JavaS cript">
<!--
function _ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang() {
var value = document.getEle mentById( "_ctl12_cob_cli ent" ).value;
var para_0=2;
AjaxMethods.Get ChannelsByClien tByLang( value, para_0,
_ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang_callb ack );
}
function
_ctl12_cob_clie ntAjaxMethods_G etChannelsByCli entByLang_callb ack(
response ) {
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var reciever = document.getEle mentById("_ctl1 2_acob_channel" );
var viewStateElem =
document.getEle mentsByName("_c tl12_acob_chann el_VIEWSTATE")[0];
Fill_ListContro lFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )
_ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g()
} else {
alert("DataSet corrupted or no data");
}
}
function _ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g() {
var value = document.getEle mentById( "_ctl12_acob_ch annel" ).value;
var para_0=document .getElementById ("_ctl12_cob_cl ient").value;
var para_1=2;
AjaxMethods.Get CategoryByChann elClientLang( value, para_0, para_1,
_ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g_callback );
}
function
_ctl12_acob_cha nnelAjaxMethods _GetCategoryByC hannelClientLan g_callback(
response ) {
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var reciever = document.getEle mentById("_ctl1 2_acob_category ");
var viewStateElem =
document.getEle mentsByName("_c tl12_acob_categ ory_VIEWSTATE")[0];
Fill_ListContro lFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )
_ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language()
} else {
alert("DataSet corrupted or no data");
}
}
function
_ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language()
{
var value = document.getEle mentById( "_ctl12_acob_ca tegory" ).value;
var para_0=document .getElementById ("_ctl12_cob_cl ient").value;
var para_1=2;
AjaxMethods.Get SubCategoriesBy MainCat_Client_ Language( value, para_0,
para_1,
_ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language_c allback
);
}
function
_ctl12_acob_cat egoryAjaxMethod s_GetSubCategor iesByMainCat_Cl ient_Language_c allback(
response ) {
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var reciever = document.getEle mentById("_ctl1 2_acob_subcateg ory");
var viewStateElem =
document.getEle mentsByName("_c tl12_acob_subca tegory_VIEWSTAT E")[0];
Fill_ListContro lFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )
} else {
alert("DataSet corrupted or no data");
}
}
function Fill_ListContro lFromDataBase( ds, reciever, viewStateElem,
textFieldName, valueFieldName ) {
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var html = [];
var i=0;
while( reciever.childN odes.length > 0 ) {
var node = reciever.childN odes[0];
reciever.remove Child( node );
}
var vs = [];
for(i=0; i<ds.Tables[0].Rows.length; i++) {
var txt = ds.Tables[0].Rows[i][textFieldName];
var id = ds.Tables[0].Rows[i][valueFieldName]
vs[vs.length] = id + ":" + txt + "|";
var opt = document.create Element("option ");
var txt = document.create TextNode( txt );
var atr = document.create Attribute( "value" );
atr.nodeValue = id;
opt.setAttribut eNode( atr );
opt.appendChild ( txt );
reciever.append Child( opt );
}
if ( viewStateElem != null ) {
viewStateElem.v alue = vs.join("");
} else {
alert("No ViewStateFound" );
}
}
}
// -->
</script>
Each function on it's own works if i remove the calls for the child
value method.
Has anyone an idea how this can happen as there is no recursion in this
functions.
thanks in advance and greetings,
chris
Comment