c# - Too much recursion from one out of two links calling the same function -


to start read alot of threads problem , solved myself before. matter leaves me confused..

code

<leads:leadslisting runat="server" id="myleadslist" list="myleads"/> <leads:leadslisting runat="server" id="newleadslist" list="unassigned" /> 

both fetches same gridview, have filters being applied them (which work fine)

this script being called on page_load

scriptmanager.registerstartupscript(     detailsupdatepanel,         detailsupdatepanel.gettype()             "clickabletrs",      "$('#" + leadsgridview.clientid + "table tr td:first-child a').each(function(){         var func = function('event', this.href.substring(\"javascript:\".length) +';         if(event.stoppropagation){event.stoppropagation();         } else{             event.cancelbubble = true;         }');         this.href = '#';         $(this).click(func);     });      $('.darkbackground, .ahover').click(function(){         $('#" + leadsgridview.clientid + " tr td:first-child a').unbind('click');         $(this).find('a').click();     });",  true); 

i not understand how first gridview (on click) gives me error saying "too recursion", while works fine on second gridview. specially when both call exact same function , same? apart being filtered :(

edit

this html rendering looks like,

<asp:gridview id="leadsgridview" runat="server" datakeynames="id" cssclass="basic" width="98%" gridlines="none" allowsorting="true" autogeneratecolumns="false" enableviewstate="true">     <headerstyle cssclass="tableheaderstyle" />     <alternatingrowstyle cssclass="darkbackground" />     <rowstyle cssclass="ahover" />     <columns>         <asp:templatefield headertext="company">             <itemtemplate>                 <asp:linkbutton runat="server" commandname="showdetailsclick" commandargument='<%# eval("id") %>'><%# eval("company") %></asp:linkbutton>             </itemtemplate>         </asp:templatefield>         <asp:boundfield datafield="city" headertext="city" />         <asp:boundfield datafield="state" headertext="state" />         <asp:templatefield headertext="created date">             <itemtemplate>                 <%# datetime.parse(eval("createddate") string).tostring("d") %>             </itemtemplate>         </asp:templatefield>         <asp:boundfield datafield="country" headertext="country" />         <asp:boundfield datafield="d1_contact__r" headertext="contact" />         <asp:boundfield datafield="d2_owner__r" headertext="owner" />         <asp:boundfield datafield="d2_contact__r" headertext="owner" />     </columns>                     </asp:gridview> 

to make whole clickable instead of link in first i'm unbinding click event , rebinding . had issues here before since ajax call (the href = javascript:__dopostback('ctl00$ctl00$mainarea$mainarea$cart$contentitem$ctl00$editcartbutton',''))


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -