This is a similar technique to the one outlined in this post. The idea is simple, you have a data value that you want to pass to a Javascript function through a button click on a GridView row. The example below shows how to pass a variable, in this case OtherID, to a Javascript function that opens a new modal window which holds a different aspx page.
function ShowOther(OtherID)
{
window.showModalDialog('OtherPage.aspx?OtherID=' + OtherID, 'dialogHeight:600px;dialogWidth:600px;')
}
In the GridView create a TemplateField and place a button inside the ItemTemplate that will trigger the Javascript function.
<asp:TemplateField HeaderStyle-Width="10%" HeaderText="Info">
<ItemTemplate>
<asp:Button ID="btnOther" runat="server" Text="Edit" OnClientClick='<%# EVAL("OtherID", "return ShowOther({0})") %>'/>
</ItemTemplate>
</asp:TemplateField>
The trick lies in evaluating the OtherID and putting the Javascript call togther in OnClientClick.