OnClick LinkButton

  • Thread starter Thread starter Gabe Matteson
  • Start date Start date
G

Gabe Matteson

I would like the linkbutton when it is clicked to exectute a delete sql
statement on the current page.

etc.
onclick="btndelete_onclick"

how do i get the linkbutton to pass the database id column value to the sub
procedure so it can delete the record? thanks for any help
 
I just using a sql data reader and outputting the data into a regular html
table using

<%Response.Write(objSQLDataReader(0) %>

i was hoping there was a way to put

<asp:LinkButton ID="lbtnDelete" onclick="btnDelete"
CommandArgument="<%Response.Write(objSQLDataReader(0))%>"
runat="server">Delete</asp:LinkButton></td>

thank you.
 
You can always do
iRecordId= Request["__EVENTARGUMENT"];

If you look at the source code of the HTML created you will notice that
CommandArgument parameter end up being moved to hidden field with name
__EVENTARGUMENT


George.
 
Ah I got it into a gridview, lots of time saved.. i have one column that is
an image column and 3 other data columns. when i click edit, it trieds to
edit the graphic column. is there a way that i can disable edits for that
column?

George Ter-Saakov said:
You can always do
iRecordId= Request["__EVENTARGUMENT"];

If you look at the source code of the HTML created you will notice that
CommandArgument parameter end up being moved to hidden field with name
__EVENTARGUMENT


George.


Gabe Matteson said:
I just using a sql data reader and outputting the data into a regular html
table using

<%Response.Write(objSQLDataReader(0) %>

i was hoping there was a way to put

<asp:LinkButton ID="lbtnDelete" onclick="btnDelete"
CommandArgument="<%Response.Write(objSQLDataReader(0))%>"
runat="server">Delete</asp:LinkButton></td>

thank you.
 
Back
Top