Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.net button stops working

Status
Not open for further replies.

Ragol1

Programmer
Oct 25, 2001
315
US
Hello,

I am using .net on a 2003 server and it seems that until you rebuild the mapping of the .net framework the button does not work.

I have seen this before. I cannot keep re creating the .net framework to resolve this issue. Please help.

Any button or control that requires postback will not work until the framework is re applied.

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
%>

<script runat="server">
Sub Page_Load()
'
End Sub

Sub btnLogin_OnClick(sender As Object, e As System.EventArgs)
If Page.IsValid Then
lblMessage.Text = "Hello World"
End If
End Sub
</script>

<html>
<head>
<title>Your Online Administrator | Powered by Mindscape</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<form runat="server" id="frm">
<table width="400" height="100%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td valign="middle">
<table width="362" align="center" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td align="center" height="20"><asp:label ID="lblMessage" runat="server"
CssClass="error" /></td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="71%">
<asp:textbox ID="txtEmail" Columns="30" CssClass="textbox" runat="server"
TextMode="SingleLine" />
</td>
</tr>
<tr>
<td>
<asp:textbox ID="txtPassword" Columns="30" CssClass="textbox" runat="server"
TextMode="Password" />
</td>
</tr>
<tr>
<td>
<asp:button ID="btnClick" Text="Login" OnClick="btnLogin_OnClick" CssClass="button"
runat="server" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<asp:validationsummary ID="vldSummary" runat="server" DisplayMode="BulletList"
ShowMessageBox="true" ShowSummary="false" />
<asp:requiredfieldvalidator ID="reqEmail" ControlToValidate="txtEmail" CssClass="error"
Display="None" ErrorMessage="Please include your email." runat="server" />
<asp:requiredfieldvalidator ID="reqPassword" ControlToValidate="txtPassword"
CssClass="error" Display="None" ErrorMessage="Please include your password."
runat="server" />
</form>

</body>
</html>
 
You dont have a handles command on the button, i think that may be causing the problem

Sub btnLogin_OnClick(sender As Object, e As System.EventArgs) handles btnLogin.Click
 
Sometimes when you cut/paste, or accidentally delete the control and re-add it (even with the same name), the handles clause that shatch mentioned will be removed. You just have to manually re-add it though.

D'Arcy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top