1) ASPX Page
<asp:TemplateField HeaderText="Start Planning" HeaderStyle-ForeColor="Black">
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="images/track1.jpg" CausesValidation="false"
CommandName="start" CommandArgument='<%#Eval("LeadId") + "," +Eval("Name")%>'
Text="Start Plan" OnClientClick="aspnetForm.target ='_blank';" ToolTip="Start Planning" />
</ItemTemplate>
</asp:TemplateField>
2) CS Page
protected void dgvContent_RowCommand(object sender, GridViewCommandEventArgs e)
{
string[] arg = new string[2];
arg = e.CommandArgument.ToString().Split(',');
Session["LeadId"] = arg[0];
Session["ClientName"] = arg[1];
//string LeadId = e.CommandArgument.ToString();
string Commandname = e.CommandName;
if (Commandname == "start")
{
lblclientName.Text = Convert.ToString(Session["ClientName"]);
//Response.Redirect("Riskprofiler.aspx?id=" + LeadId + "");
}
}
<asp:TemplateField HeaderText="Start Planning" HeaderStyle-ForeColor="Black">
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="images/track1.jpg" CausesValidation="false"
CommandName="start" CommandArgument='<%#Eval("LeadId") + "," +Eval("Name")%>'
Text="Start Plan" OnClientClick="aspnetForm.target ='_blank';" ToolTip="Start Planning" />
</ItemTemplate>
</asp:TemplateField>
2) CS Page
protected void dgvContent_RowCommand(object sender, GridViewCommandEventArgs e)
{
string[] arg = new string[2];
arg = e.CommandArgument.ToString().Split(',');
Session["LeadId"] = arg[0];
Session["ClientName"] = arg[1];
//string LeadId = e.CommandArgument.ToString();
string Commandname = e.CommandName;
if (Commandname == "start")
{
lblclientName.Text = Convert.ToString(Session["ClientName"]);
//Response.Redirect("Riskprofiler.aspx?id=" + LeadId + "");
}
}
No comments:
Post a Comment