为什么我在添加属性事件时需要按两次按钮 [英] Why i need to press button twice when i add Attribute event

查看:71
本文介绍了为什么我在添加属性事件时需要按两次按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello先生/女士,



我想以编程方式触发点击事件,所以我使用属性事件,如下所示



((Button)grdEmpwiseAtt.Rows [index] .FindControl(btnDetails))。Attributes.Add(onclick,OpenChild('GetLog'));



当我点击按钮,事件起火但弹出不会打开所以我需要再次点击打开弹出窗口。

我怎样才能解决问题,我只想点击一下



回复

提前致谢,

yogesh Kansete

Hello Sir/Madam,

I want to fire click event programmatically so i use Attribute event as i written below

((Button)grdEmpwiseAtt.Rows[index].FindControl("btnDetails")).Attributes.Add("onclick", "OpenChild('GetLog')");

when i click on button, event get fire but pop up will not be open so i need to click once again to open popup window.
How can i solve the issue, i want it on a single click

Reply
Thanks in advance,
yogesh Kansete

推荐答案

on首先单击属性添加,然后再单击它。





在页面加载时使用它。或者在此之前(((Button)grdEmpwiseAtt.Rows [index] .FindControl(btnDetails))。Attributes.Add(onclick,OpenChild('GetLog'));)你发射的事件
on First click attribute add and second click it fire.


use it on a page load. or before this (((Button)grdEmpwiseAtt.Rows[index].FindControl("btnDetails")).Attributes.Add("onclick", "OpenChild('GetLog')");) event which u fire


这篇关于为什么我在添加属性事件时需要按两次按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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