这个javascriptc来自哪里...... [英] Where does this javascriptc come from ...

查看:67
本文介绍了这个javascriptc来自哪里......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。



场景

我有一个带有ItemTemplateField的简单GridView复选框在里面。这样的Checkbox连线触发onCheckedChanged事件,由于某种原因我忽略了,只在检查时触发,但不是取消选中。反过来,这种性质的每个onCheckedChanged事件都会在另一个控件触发其服务器端事件之后依次提示如何,某处和按顺序触发。



无论如何,这不是这个问题。这是网格,如你所见,checkbos没有绑定到任何数据源:



Hello everyone.

Scenario:
I have a simple GridView with an ItemTemplateField which has a Checkbox in it. Such Checkbox is wired to fire the onCheckedChanged event, which for some reason I ignore, only fires when checking, but not unchecking. In turn, every onCheckedChanged event of such nature get cued some how, somewhere, and fire in sequence after another control triggers its on server side event.

Anyhow, that's not the question. Here's the grid, and as you can see, the checkbos is not bound to any data source:

<asp:GridView ID="Grid" runat="server" AutoGenerateColumns="False"  >
         <Columns>
             <asp:TemplateField Visible="false">
                 <ItemTemplate><asp:Label id="lbCesionID" runat ="server" Text='<%# Eval("idCesion") %>' /></ItemTemplate>
             </asp:TemplateField>
             <asp:TemplateField>
                 <ItemTemplate><asp:CheckBox runat="server" ID="chkSelected" AutoPostBack="true" OnCheckedChanged="GridCheckedChanged" Checked="false" /></ItemTemplate>
             </asp:TemplateField>
             <asp:BoundField DataField="DBSourceField" HeaderText="ThisHeader" ></asp:BoundField>
         </Columns>
     </asp:GridView>







查看HTML代码,我发现这附在我的身上复选框






Looking a the html code, I found this attached to my checkboxes:

onclick="javascript:setTimeout('__doPostBack(\'ctl00$MainContent$ucCesionesDocs$Grid$ctl02$chkSelected\',\'\')', 0)"





因为我不知道它是怎么来的在那里,我肯定会把它归咎于我的障碍。



有谁知道这件事来自哪里? 我可以在不知情的情况下添加它。如果是这样,我怎么能摆脱它?



感谢您的帮助。



< b>我尝试了什么:



拦截OnRowDataBound事件,找到网格行中的复选框,并删除onclick属性,但是javascript调用仍然存在。



我发现在JQuery中定义了一个setTimeout函数,但是,我再次没有添加这样的东西(至少是故意的)。



And since I have no clue how it got there, I am most certainly blaming it for my hurdle.

Does anybody know where does such thing comes from? Where could I possible be adding it without knowing. If so, how can I get rid of it?

Thank you for your help.

What I have tried:

Intercepting the OnRowDataBound event, locating the checkbox within the grid's row, and removing the "onclick" attribute, but that javascript call remains in place.

I found a setTimeout function defined in JQuery, but, again, I am not adding such thing (at least on purpose).

推荐答案

MainContent
MainContent


ucCesionesDocs
ucCesionesDocs


Grid


这篇关于这个javascriptc来自哪里......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆