N
Nuno
Hi
I create a new .aspx page only with a button and a span (as you can
see)...simple
When I try to click the button returns JS error (__EVENTTARGET is null
or not an object). I research about it and I found some interesting
conclusions,
some people said that this bug was fixed with the SP1 of .NET1.1
others suggests a work around technique.
on a first aproach I installed SP1 but the error persists then I try
to follow a work around technique, adding a directive to the page
(Page.RegisterHiddenField( "__EVENTTARGET", myButtonName)
to initialize the EVENTTARGET variable but still not working.
What should I do in order to put a simple event running?
<!-- File: Example6.aspx -->
<%@ Page Language="C#" %>
<script runat="server">
protected void OnClickMyButton(object src, EventArgs e)
{
_message.InnerText = "You clicked the button!";
}
</script>
<html>
<body
<form runat="server">
<h2>ASP.NET event page</h2>
<p>
<input type="button" value="Click me!" id="mybutton" name="mybutton"
OnServerClick="OnClickMyButton" runat="server"/>
</p>
<span name="_message" id="_message" runat="server"/>
</form>
</body>
</html>
I create a new .aspx page only with a button and a span (as you can
see)...simple
When I try to click the button returns JS error (__EVENTTARGET is null
or not an object). I research about it and I found some interesting
conclusions,
some people said that this bug was fixed with the SP1 of .NET1.1
others suggests a work around technique.
on a first aproach I installed SP1 but the error persists then I try
to follow a work around technique, adding a directive to the page
(Page.RegisterHiddenField( "__EVENTTARGET", myButtonName)
to initialize the EVENTTARGET variable but still not working.
What should I do in order to put a simple event running?
<!-- File: Example6.aspx -->
<%@ Page Language="C#" %>
<script runat="server">
protected void OnClickMyButton(object src, EventArgs e)
{
_message.InnerText = "You clicked the button!";
}
</script>
<html>
<body
<form runat="server">
<h2>ASP.NET event page</h2>
<p>
<input type="button" value="Click me!" id="mybutton" name="mybutton"
OnServerClick="OnClickMyButton" runat="server"/>
</p>
<span name="_message" id="_message" runat="server"/>
</form>
</body>
</html>