Using ASP.NET Web Forms, Passing Primary Key to RowCommand Event

  I know this is old hat, but after recently having a conversation with one of the ASP.NET Team guys about how easy Web Forms is to use, I thought I’d just post a simple example of that.  Here is the scenario.  You have a simple GridView with just three columns (Select,Id,TagName).  You want to be able to capture what happens when the user pressed the Select command and capture the Id.  It looks like this:     And has an aspx page like this:   <asp:GridView ID="GridViewNotSelected" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSourceTagsNotSelected" … Continue Reading

With ASP.NET WebForms, How to Keep / Stop a Data Control Like GridView From Retrieving Data

The What and Where Something that may not be obvious is if are creating an WebForms project and you put a datasource such as SqlDataSource or ObjectDataSource for example on the page, how can you prevent the SqlSelect associated with that datasource from being triggered. The answer is to set the control’s visible property to false.  That’s it! … Continue Reading


Get every new post delivered to your Inbox

Join other followers: