473,480 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

.aspx page wont work!

Hi,
I am trying to run a simple asp .net page that has a button and a text
box on it. When the user clicks on the button the text box has some text put
into it. But it doesnt even fire the button click event when the button is
clicked on the text box remains unchanged.

Anyone got any ideas? Below is the code & html.

Thanks in advance
Paul M.

====================================
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm2.aspx.vb"
Inherits="PLDB_WWW.WebForm2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm2</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<INPUT id="Button1" style="Z-INDEX: 101; LEFT: 7px; WIDTH: 58px;
POSITION: absolute; TOP: 33px; HEIGHT: 186px" type="button" value="Button"
name="Button1" runat="server">&nbsp;&nbsp;
<asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 157px; POSITION:
absolute; TOP: 39px" runat="server" Width="289px" Height="190px"
ForeColor="Black">wwwwwwww</asp:TextBox>
</form>
</body>
</HTML>
====================================
Public Class WebForm2

Inherits System.Web.UI.Page

Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox

Protected WithEvents Button1 As System.Web.UI.HtmlControls.HtmlInputButton

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_ServerClick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.ServerClick

TextBox1.Text = "Success"

End Sub

End Class


Nov 17 '05 #1
2 1755
try using the asp:button server control and see if it works
"Paul M." <pa**@nospam.fsnet.co.uk> wrote in message
news:bg**********@news8.svr.pol.co.uk...
Hi,
I am trying to run a simple asp .net page that has a button and a text
box on it. When the user clicks on the button the text box has some text put into it. But it doesnt even fire the button click event when the button is
clicked on the text box remains unchanged.

Anyone got any ideas? Below is the code & html.

Thanks in advance
Paul M.

====================================
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm2.aspx.vb" Inherits="PLDB_WWW.WebForm2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm2</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<INPUT id="Button1" style="Z-INDEX: 101; LEFT: 7px; WIDTH: 58px;
POSITION: absolute; TOP: 33px; HEIGHT: 186px" type="button" value="Button"
name="Button1" runat="server">&nbsp;&nbsp;
<asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 157px; POSITION:
absolute; TOP: 39px" runat="server" Width="289px" Height="190px"
ForeColor="Black">wwwwwwww</asp:TextBox>
</form>
</body>
</HTML>
====================================
Public Class WebForm2

Inherits System.Web.UI.Page

Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox

Protected WithEvents Button1 As System.Web.UI.HtmlControls.HtmlInputButton

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_ServerClick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.ServerClick

TextBox1.Text = "Success"

End Sub

End Class



Nov 17 '05 #2
Make sure you have the "If Postback then exit sub" at the top of the
Page_Load procedure.

/john

"Paul M." <pa**@nospam.fsnet.co.uk> wrote in message
news:bg**********@news8.svr.pol.co.uk...
Hi,
I am trying to run a simple asp .net page that has a button and a text
box on it. When the user clicks on the button the text box has some text put into it. But it doesnt even fire the button click event when the button is
clicked on the text box remains unchanged.

Anyone got any ideas? Below is the code & html.

Thanks in advance
Paul M.

====================================
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm2.aspx.vb" Inherits="PLDB_WWW.WebForm2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm2</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<INPUT id="Button1" style="Z-INDEX: 101; LEFT: 7px; WIDTH: 58px;
POSITION: absolute; TOP: 33px; HEIGHT: 186px" type="button" value="Button"
name="Button1" runat="server">&nbsp;&nbsp;
<asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 157px; POSITION:
absolute; TOP: 39px" runat="server" Width="289px" Height="190px"
ForeColor="Black">wwwwwwww</asp:TextBox>
</form>
</body>
</HTML>
====================================
Public Class WebForm2

Inherits System.Web.UI.Page

Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox

Protected WithEvents Button1 As System.Web.UI.HtmlControls.HtmlInputButton

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_ServerClick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.ServerClick

TextBox1.Text = "Success"

End Sub

End Class



Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
3864
by: NotGiven | last post by:
I am guessing I would hold a variable of when it's opened, then in the script that runs when the page is offloaded, I coudl calcualte it. How do you store a time variable? How do you calculate...
4
1772
by: Steve Westwood | last post by:
I have a WebForm button. Depending on calculation I wont to send a popup message to the web page. I am not sure of the approach. From the server side code I don't seem to be able to access the...
5
3502
by: M Luper | last post by:
I have visualStudio.NET on my laptop. The OS on the laptop is XP Proffesional. When I installed visualStudio.NET on my laptop I thought that all of the dotnet framework was installed, but when I...
6
4114
by: Gary | last post by:
I have the following in my web.config.... <customErrors mode="RemoteOnly" defaultRedirect="Applicationerror.aspx"/> but, my error page does not display. Instead a 'Runtime Error' page...
10
3202
by: moondaddy | last post by:
I'm writing an ecommerce app in asp.net/vb.net and need to make the pages searchable and crawlable by spiders, particularly Google's. As far as I know, if my pages's contents are mostly populated...
4
1706
by: roger janssens via DotNetMonster.com | last post by:
hello all. i'm used to scripting in php. there, you just include(bla.php) and it works. so i have a template that defines my layout and stays the same forever, but in that file, there's a table...
6
2924
by: Support | last post by:
Hello: USing the code behind model, i do not understand how to do a conditinal space in the aspx page. For example: I have two tables, under condition 1 I want table 1 to show and under condition...
5
2330
by: moondaddy | last post by:
I have a .net 2.0 winforms app that calls a web service which creates creates a GUID and caches it, then passes the GUID back to the winform. then it opens a aspx page and passes the GUID as a...
13
1598
by: slinky | last post by:
I'm working on a problem with a form with 6 textboxes and a submit button for adding data to an Access database.I changed a few things and got it down to 1 error!. I have a Sub Page_Load and a Sub...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7032
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6730
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4767
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.