Click here to Skip to main content
13,090,299 members (76,207 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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

Thanks in advance,
yogesh Kansete
Posted 24-Jun-13 19:44pm
Updated 25-Jun-13 1:17am
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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 26 Jun 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100