Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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 27th, 2006, 02:46 AM
Authorized User
 
Join Date: Dec 2005
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataGrid LinkButtons/Pushbuttons

Hi folks,

The problem I have is this:

I have a DataGrid named dgResults with a Select Button Colunm. The Command name is cmdEditVisit, and the button type is a LinkButton. The below code catches when this button is click as simply redirects them off to a different page. :)

Code:
Private Sub dgResults_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgResults.ItemCommand
 If e.CommandName = "cmdEditVisit" Then
     Response.Redirect("EditVisit.aspx?MR=" & strMSMROL)
 End If
End Sub
As soon as I change the ButtonType to a PushButton the above code does not catch when the button it clicked on, and I cannot figure out why this is the case.

If anyone has any ideas why, please let me know.

Thanks:)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Iterating through the LinkButtons in a page. nocofoolme ASP.NET 2.0 Basics 23 August 13th, 2008 04:01 PM
Custom paging in Datagrid with datagrid page count madhusrp ASP.NET 1.0 and 1.1 Professional 12 June 2nd, 2008 01:15 PM
User COntrol Datagrid inside datagrid rodmcleay ASP.NET 1.0 and 1.1 Professional 3 April 14th, 2007 10:11 AM
filtering datalist with linkbuttons pettrer ASP.NET 2.0 Basics 0 July 8th, 2006 03:46 PM
LinkButtons Alaric VS.NET 2002/2003 1 November 7th, 2003 01:34 AM





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