How do I correctly send send Event Argss with ans ASP OnClick Event
Posted on 2008-10-11
I am trying to send an image url to an OnClick method but am unsure of the syntax required.
Basically, I have this ImageButton (ASP2.0)
<asp:ImageButton ID="btnUpdate" runat="server" ImageUrl ="~/images/mikey.jpg" OnClick = "btnUpdate_Click" CommandName = "passUrl" CommandArgument = "ImageButton2.ImageUrl.ToString()"/>
I would like the url in Command Argument to be passed to the following method
protected void btnUpdate_Click(object sender, EventArgs e)
ImageButton1.ImageUrl = e.ToString();
Whereby ImageButton1 would then display the same image as the ImageButton that was clicked.
Am I even close??