---
title: "Redirect to specific page when a gridview buttonfield is clicked"  
description: "Redirect to specific page when a gridview buttonfield is clicked"  
author: "Manoj Bhatt"  
published: 2014-09-05  
updated: 2014-09-05  
canonical: https://www.mindstick.com/forum/2254/redirect-to-specific-page-when-a-gridview-buttonfield-is-clicked  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Redirect to specific page when a gridview buttonfield is clicked

I have two [fields](https://www.mindstick.com/forum/159126/sql-query-for-all-tables-and-fields-in-an-oracle-db) in my gridview. One is a [field](https://www.mindstick.com/forum/160867/does-mindstick-provide-training-for-field-marketing) with a [date](https://yourviews.mindstick.com/story/3869/propose-day-2024-exciting-date-ideas-for-you-and-your-partner) [range](https://www.mindstick.com/articles/23243/complete-troubleshooting-tips-for-belkin-n300-range-extender-setup) and [one of them](https://answers.mindstick.com/qa/47593/what-are-the-prevalent-water-proofing-systems-write-a-short-notes-on-any-one-of-them) is a buttonfield. I want to make it so that when a [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) is clicked, it will [redirect](https://www.mindstick.com/forum/2005/radio-button-redirect) them to a specific [page](https://www.mindstick.com/articles/13031/why-to-make-a-wikipedia-page) with a formatted [string](https://www.mindstick.com/articles/1527/string-split-in-c-sharp) similar to how it's done when a hyperlinkfield is clicked as such:

DataNavigateUrlFormatString="ProductInfo.aspx?ProductID={0}"

Is there a way I can do the same thing with a button?

## Replies

### Reply by Sumit Kesarwani

Hi Manoj, \

Try using this type of column instead of a ButtonField:

```
<Columns>  
<asp:HyperLinkField  DataTextField="ProductName" HeaderText="Product Name"     
SortExpression="ProductName"     
DataNavigateUrlFields="ProductID"     
DataNavigateUrlFormatString="ProductInfo.aspx?ProductID={0}"/></Columns>
```


---

Original Source: https://www.mindstick.com/forum/2254/redirect-to-specific-page-when-a-gridview-buttonfield-is-clicked

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
