Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 25th, 2008, 10:37 AM
Registered User
 
Join Date: Jun 2008
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:TemplateColumn>

<ItemTemplate>

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



</ItemTemplate>

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

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

</asp:TemplateColumn>

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



 
Old June 26th, 2008, 12:05 AM
Authorized User
 
Join Date: Apr 2008
Posts: 54
Thanks: 0
Thanked 4 Times in 4 Posts
Default

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
http://www.vbknowledgebase.com/WebAp...ew-walkthrough





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





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