How to Pass parameter to SQlDataSource from gridview?
Posted
by user144842
on Stack Overflow
See other posts from Stack Overflow
or by user144842
Published on 2010-04-07T15:50:38Z
Indexed on
2010/04/07
15:53 UTC
Read the original article
Hit count: 504
Gridview has many columns and a Delete button as well. Delete button is a control as TemplateField
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="btnDelete" CommandName="Delete" Text='<%# Eval("disabled").ToString()=="False" ? "Disabled" : "Enabled" %>'
OnClientClick="return confirm('Are you sure you want to take this action?');"
runat="server"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
Now associated SQLDataSource's Delete command's stored procedure is expecting two parameters. One is going from DataKeyNames (RowID), other one i wanna pass is the Text of btnDelete (True or False).
How can i achieve it?
© Stack Overflow or respective owner