asp:DetailsView如何加JS

来源:百度知道 编辑:UC知道 时间:2024/05/25 13:03:47
asp:DetailsView里面生成的按钮如何加JS判断
能说的详细一点吗,我听不明白
因为按钮在asp:DetailsView里没有明确的代码

不明白你的意思,能说得详细点或者给个例子吗

谢谢
但是asp:DetailsView里的按钮没有固定的button他只是<asp:CommandField ShowEditButton="True" ShowInsertButton="True" InsertText="Add" />一段话

切换到源视图,添加你的事件(用脚本写)

detailsview 我没用过
我用gridview的时候是有rowcommand的,你通过rowcommand来根据CommandName决定执行什么操作

仅供参考,还是不行,再告诉我,可以研究下

这样的提示,不需要通过服务器事件来做,直接添加模板列,然后就可以使用clientclick来使用脚本提示

具体的例子,我刚才发给你了(这里当时答不上),你自己先摸索着,或者你星期一再消息提醒我补充下回答

<asp:DetailsView ID="DetailsView1" runat="server"
DataSourceID="SqlDataSource1" Height="50px" Style="z-index: 105; left: 44px; position: absolute; top: 357px" Width="125px">
<Fields>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton runat="server" OnClientClick=" javascript:return confirm('你确认要删除吗?')">删除</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Fields>
</asp:DetailsView>