1

I have dataGrid and LinkButton with javascript, how to get ID for MessageSend function?

<ItemTemplate>
<asp:ImageButton ID="MessageButton" runat="server" OnClientClick="javascript:void(MessageSend(SomeID))"  ImageUrl="Header.gif"/>
</ItemTemplate>

<asp:BoundColumn Visible="True" DataField="SomeID" ReadOnly="True" HeaderText="ID"></asp:BoundColumn>

1 Answer 1

1

do this way

function MessageSend(sender) {
    // do whatever with the input
}

and in the OnClientClick use javascript:MessageSend(this);

The result is you get the sender element in your routine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.