G
Guest
hi there, I am using c#, not quite sure how to get an argument into an event.
protected void btnRedirect_Click (object sender, eventargs e) {
go to url newpage?id=[id i passed]
}
i know sender is whatever control invoked this code (e.g. button) but not
sure what the eventargs is for. I have a button which performs a click event.
But I want to send a value to the click event (an id to be passed in an url
redirection). How do I put this string into the argument list of the click
event?
I am also trying to put the id into the click in the html and this is
returning an error (asp server control not formed). The value I want to pass
comes from an asprepeater. what am i missing in the following?
<asp:ImageButton id="btnNext" ImageURL="~/images/but_next.gif" height="17px"
width="48px" onclick="btnViewClient_Click(<%#
DataBinder.Eval(Container.DataItem, "ClientID") %>)" runat="server"/>
Thank you.
protected void btnRedirect_Click (object sender, eventargs e) {
go to url newpage?id=[id i passed]
}
i know sender is whatever control invoked this code (e.g. button) but not
sure what the eventargs is for. I have a button which performs a click event.
But I want to send a value to the click event (an id to be passed in an url
redirection). How do I put this string into the argument list of the click
event?
I am also trying to put the id into the click in the html and this is
returning an error (asp server control not formed). The value I want to pass
comes from an asprepeater. what am i missing in the following?
<asp:ImageButton id="btnNext" ImageURL="~/images/but_next.gif" height="17px"
width="48px" onclick="btnViewClient_Click(<%#
DataBinder.Eval(Container.DataItem, "ClientID") %>)" runat="server"/>
Thank you.