Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hello Sir/Madam,

I want to fire click event programmatically so i use Attribute event as i written below
C#
((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
Posted
Updated 25-Jun-13 1:17am
v2
Comments
Sunasara Imdadhusen 25-Jun-13 7:18am    
when click on page is your page will postback after?
sjelen 25-Jun-13 7:25am    
Not enough details, but it looks like javaScript problem. Provide the code for OpenChild function.
Is your grid inside UpdatePanel? Does it trigger server-side events?
Suvabrata Roy 25-Jun-13 7:54am    
You write this code on page load or button click event?

1 solution

You need to bind the event when the page loads. I assume you're adding it after you have clicked the button which is why it is requiring 2 clicks. If this is not the case, please provide the method your code above resides in.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900