Here's what is in my .aspx:
<div><input id="testButton" type="image" src="<%=TestImageUrl %>" onserverclick="RedirectTest" /></div>
And in my code-behind this:
protected void RedirectTest(object sender, EventAr开发者_StackOverflow中文版gs e)
{
// Logic is here
}
It's not hitting my method at all when I click the image. And please note, I do not want to use an ImageButton. I want to figure out how to get this working with a plain old input tag.
Seems like you're missing the runat="server" attribute on the input tag.
You need to add runat='server'
to the input's definition
you need to add a runat="server"
attribute to your input tag.
精彩评论