Now I'm a little confused. Let me explain:
I saw people talking about adding a button or some other control to a page in asp.net (3.5), and when the control displays it, the identifier of that control, for example. Button1 becomes Button1_somethings something that prevents them from using jQuery, and what they use is something like<%controlId.ClientId %>
So I did a little test
1. I added a button on the page:
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" />
<div>
2. Then I added a JavaScript and jQuery:
<script type="text/javascript">
$(document).ready(function() {
$("#Button1").click(function() {
alert("Hello world!");
});
});
</script>
3. The generated html is this:
<div>
<input type="submit" name="Button1" value="Button" id="Button1" />
<div>
Now I do not see how ASP.NET (asp.net 3.5) changes identifiers. Why am I seeing a different behavior?
Btw. It works when I press the button!
Thanks.
ra170