Click here to Skip to main content
11,710,824 members (84,779 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP.NET
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
Edited 25-Jun-13 1:17am
Sunasara Imdadhusen at 25-Jun-13 7:18am
when click on page is your page will postback after?
sjelen at 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 at 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
0 Sergey Alexandrovich Kryukov 549
1 OriginalGriff 270
2 Peter Leow 134
3 Abhinav S 130
4 Richard MacCutchan 80
0 Abhinav S 60
1 Member 4653839 40
2 barneyman 35
3 Sergey Alexandrovich Kryukov 35
4 Member 11793820 35

Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 26 Jun 2013
Copyright © CodeProject, 1999-2015
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