Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 25th, 2008, 10:37 AM
Registered User
Join Date: Jun 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Link button in nested grids clcik doesnt work fir

Hi all,

I have a Nested grids ( datagrid inisde a gridview ). I placed a Link Button inisde teh datagrid and specified the command argumnet and command name.

Based on the command name I want to open a popup window.

This doesnt work for the first time , but works when i click on teh second time.

Heres my code... Please help:



<asp:LinkButton ID="lnkbtnAgency" runat="server" Text='<%# Bind("AgencyName") %>' CommandName="Agency" CommandArgument='<%#Bind("AgencyId") %>'></asp:LinkButton>


<HeaderStyle HorizontalAlign="Center" Width="162px" />

<ItemStyle BackColor="#BEDAFE" HorizontalAlign="Center" />


Private Sub dgchild_Itemcommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs )
If (e.CommandName = "Agency") Then

Dim rindex As Integer = DirectCast(DirectCast(source, DataGrid).Parent.Parent, GridViewRow).RowIndex
Session("StartDate") = CType(gvParent.Rows(rindex).FindControl("LabelStar tdate"), Label).Text

Session("Enddate") = CType(gvParent.Rows(rindex).FindControl("LabelEndd ate"), Label).Text
Dim agencyid As Integer = e.CommandArgument

Dim lnkAgency As LinkButton = CType(e.Item.FindControl("lnkbtnAgency"), LinkButton)
lnkAgency.OnClientClick = "javascript:openPopup('Agency_TrainingDetails.aspx ?Agency_id=" + agencyid.ToString + "');"

End If

End Sub

And I raised a event for the child datagrid Item command in the parent ridview then in that i have written this code:

I traced and seems to working fine.. but dont understnd why its not working for the first time.

Can some body let me know , where I am going????

Your help is very much appreciated

Reply With Quote
  #2 (permalink)  
Old June 26th, 2008, 12:05 AM
Authorized User
Points: 198, Level: 3
Points: 198, Level: 3 Points: 198, Level: 3 Points: 198, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Apr 2008
Location: singapore, singapore, Singapore.
Posts: 54
Thanks: 0
Thanked 4 Times in 4 Posts

can you please check the view source of the rendered page on first click and check javascript:openPopup('Agency_TrainingDetails.aspx? Agency_id=" + agencyid.ToString + "');" is rendered or not

based on my understanding from your query. i would suggest you to add the client click method in rowDataBound

Pon Saravanan
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
c:out doesnt work tllcll JSP Basics 1 November 1st, 2007 03:15 AM
Link Button does not work properly nitinp ASP.NET 2.0 Basics 0 November 9th, 2006 06:02 AM
Event Handling in Nested Grids bala24 General .NET 0 May 12th, 2006 02:51 AM
Button doesnt work help john111 Java GUI 4 March 21st, 2006 05:22 PM
WHY DOESNT THIS WORK vb certified Pro VB.NET 2002/2003 5 August 1st, 2005 11:08 PM

All times are GMT -4. The time now is 02:07 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.