hi,
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="Checkdata" runat="server" />
<asp:HyperLink ID="HlnkShow" runat="server" Text='<%#Eval("name")%>' NavigateUrl='<%# String.Format("view.aspx?/{0}/&type={1}&area={2}&ID={3}&companyname={4}", Eval("city"),Eval("Type"),Eval("Area"),Eval("Sno"),Eval("Name"))%>'>
</asp:HyperLink>
<asp:Label ID="Label8" runat="server" Text=' <%#Eval("rate") %>'></asp:Label>
<asp:Label ID="Label9" runat="server" Text="Ratings"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:ImageButton ID="senddetails" runat="server" ImageUrl="~/images/send_btn.png"
OnClick="senddetails_Click1" />
protected void senddetails_Click1(object sender, ImageClickEventArgs e)
{
string str = string.Empty;
string strname = string.Empty;
foreach (GridViewRow gvrow in gvcategory.Rows)
{
CheckBox chk = (CheckBox)gvrow.FindControl("Checkdata");
if (chk != null & chk.Checked)
{
str += gvcategory.DataKeys[gvrow.RowIndex].Value.ToString() + ',';
strname += gvrow.Cells[2].Text + ',';
}
}
str = str.Trim(",".ToCharArray());
strname = strname.Trim(",".ToCharArray());
}
i'm selecting one checkbox and click on button
then it does'nt goes to foreachloop why?
please help me
it's important to me