Cybercrux

Everything is achievable through technology

Command Argument

——Delete Command argument——–

<asp:TemplateField ItemStyle-Width=”10%” ItemStyle-CssClass=”GridDataLeft” HeaderText=”Delete”>
<ItemTemplate>
<a title='<%# DataBinder.Eval(Container.DataItem,”Srno”)%>’ onclick=”return confirm(‘Are u want to delete’);”
onserverclick=”DeleteJob” runat=”server” id=”A1″>
<center>
<img src=”../App_Themes/Common/images/delete.gif” alt=”delete” /></center>
</a>
</ItemTemplate>
<HeaderStyle CssClass=”GridHeadCenter” Width=”10%” />
</asp:TemplateField>

 

public void DeleteJob(object s, System.EventArgs e)
{
HtmlAnchor deletelnk = (HtmlAnchor)s;
int srno = int.Parse(deletelnk.Title);
obj.CONTACTUS(“D”,srno,””, “”, “”, “”, “”);
Response.Redirect(“../Admin/AddContactus.aspx?id=6&type=show”);

}
——Active Command argument——–

<asp:TemplateField HeaderText=”Active” HeaderStyle-CssClass=”GridHeadCenter”>
<ItemStyle CssClass=”GridDataCenter” Wrap=”false”></ItemStyle>
<ItemTemplate>
<a style=”cursor: pointer;”>
<asp:ImageButton ID=”ActiveImg” runat=”server” OnCommand=”ActiveImg_Command”></asp:ImageButton></a>
</ItemTemplate>
</asp:TemplateField>

public void ActiveImg_Command(object sender, CommandEventArgs e)
{
ImageButton ActiveImg = (ImageButton)sender;
GridViewRow DItem = (GridViewRow)ActiveImg.NamingContainer;
string SqlText = string.Empty;
if (ActiveImg.ImageUrl.IndexOf(“enable.gif”) != -1)
{
ActiveImg.ImageUrl = “../App_Themes/Common/images/disable.gif”;

Admin.Admincareer(ActiveImg.Attributes[“Srno”].ToString(), “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “0”, “UpdateCid”, “”, “”, “”, “”, “”, “”, “”);
}
else
{
ActiveImg.ImageUrl = “../App_Themes/Common/images/enable.gif”;

Admin.Admincareer(ActiveImg.Attributes[“Srno”].ToString(), “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “1”, “UpdateCid”, “”, “”, “”, “”, “”, “”, “”);
}
binddata();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s