In your datagrid give add to your button the commandName attribute like so

<asp:Button Text="Book >>" id="BookHotel" Runat="server"
commandName="SelectRow"></asp:Button>

To the datagrid add OnItemCommand="OnRowSelected" 

in your code behind, add the following function

protected void OnRowSelected ( object sender, DataGridCommandEventArgs e )
{
   if ( e.CommandName == "SelectRow" )
   {
        //Add your logic to pull out the rows values
       //e.Item.FindControl ( ) will help you access the controls in
the data row
   }
}

Hope this helps




On Sun, 27 Feb 2005 05:23:57 +0000 (GMT), Arindam <[EMAIL PROTECTED]> wrote:
> 
> In DataGrid 
> i have 5 columns, one column is "GO >>" (is a serverside button).
> now i want when someone click on some particular "go" button all data field
> of that row 
> should be inserted in Cache, and page should be redirected  to next page :
> 
> Suppose i have columns in Datagrid like this :
> 
> <Columns>
> <asp:TemplateColumn HeaderText="Room Type">
> <ItemTemplate>
>   <asp:HyperLink ID="Roomtype_Name" Runat="server">
>    <%#DataBinder.Eval(Container,"DataItem.roomtypeName")%>
>   </asp:HyperLink>
> </ItemTemplate>
> </asp:TemplateColumn>
> <asp:BoundColumn HeaderText="Capacity"
> DataField="Capacity"></asp:BoundColumn>
> <asp:TemplateColumn HeaderText="Rate">
> <ItemTemplate>
>   <asp:Label ID="Room_Rate" Runat="server">
>    <%#DataBinder.Eval(Container,"DataItem.roomRate")%>
>   </asp:Label>
> </ItemTemplate>
> </asp:TemplateColumn>
> <asp:TemplateColumn HeaderText="Book Now"
> FooterStyle-HorizontalAlign="Center">
> <ItemTemplate>
>   <asp:Button Text="Book >>" id="BookHotel" Runat="server"></asp:Button>
> </ItemTemplate>
> </asp:TemplateColumn>
> </Columns>
> 
> 
> 
> 
> Thanks & Regards
> 
> Arindam 
> Web Designer & Developer  
> 
> 
> 
> 
> Yahoo! India Matrimony: Find your life partneronline.
> 
> [Non-text portions of this message have been removed]
> 
> 
> Yahoo! Groups Sponsor
> ADVERTISEMENT
> 
> ________________________________
> Yahoo! Groups Links
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>   
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>   
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


-- 
Doug Nelson
www.synappnorth.com


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to