Click here to Skip to main content
Rate this: bad
good
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
 
Reply
Thanks in advance,
yogesh Kansete
Posted 24-Jun-13 20:44pm
Edited 25-Jun-13 2:17am
v2
Comments
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
good
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.
  Permalink  

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 334
1 Kornfeld Eliyahu Peter 325
2 Maciej Los 239
3 OriginalGriff 188
4 King Fisher 185
0 OriginalGriff 6,303
1 DamithSL 4,764
2 Maciej Los 4,306
3 Kornfeld Eliyahu Peter 3,914
4 Sergey Alexandrovich Kryukov 3,538


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