In this Blog like to share you how we can do some scripting in Gridview hyperlink & conditional formatting.
below is example
Onclick i am opening a popup window for Activation and Deactivation on value which i get in IsActive
if it true then run a javascript function ConfirmDeActiveUsers,in this Function i can pass value with the help of following way.Command is nothing but value i need to pass it to javascript function or can even use javascript over there for example i can use Alert Function in Javascript to alert ID of that particular item
<asp:HyperLink Text='<%# Convert.ToBoolean(Eval("IsActive")) ? "Deactivate" : "Activate" %>' runat="server" ID="hyperlnkView" OnClick='<%# Convert.ToBoolean(Eval("IsActive")) ? Eval("command","return ConfirmDeActiveUsers(\"{0}\");") : Eval("command","ConfirmNonActiveUsers(\"{0}\");") %>' ></asp:HyperLink>
No comments:
Post a Comment