.aspx page wont work!

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default .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








    Paul M. Guest

  2. Similar Questions and Discussions

    1. SQL wont work
      Can anyone suggest why this SQL wont work? Someone has suggested that I have a few " in the wrong place. I am missing the basic understanding...
    2. Accessing a aspx page using HttpWebRequest from another aspx page on the same webapp
      Did you have any luck on this as I have the same problem. Maybe you can help me out of you solved your problem.
    3. Can anyone tell me why this wont work
      Dear Stephen on stopMovie repeat with n in the windowlist -- forget n -- use this forget the windowlist end repeat end
    4. Can anyone tell me why this wont work??
      I am trying to check and see if a field is posted or not, if not posted then assign $location which is a session variable to $location_other. If...
    5. how to interact client script within aspx page to other page functions, etc.? PLEASE!!!
      Hi, I've spent all day trying to find some info on this...please help! I have an aspx page with an xmlDocument (not dataset/relational db) with...
  3. #2

    Default Re: .aspx page wont work!

    try using the asp:button server control and see if it works
    "Paul M." <paul@nospam.fsnet.co.uk> wrote in message
    news:bggj0q$llg$1@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
    >
    >
    >
    >
    >
    >
    >
    >

    Showjumper Guest

  4. #3

    Default Re: .aspx page wont work!

    Make sure you have the "If Postback then exit sub" at the top of the
    Page_Load procedure.

    /john

    "Paul M." <paul@nospam.fsnet.co.uk> wrote in message
    news:bggj0q$llg$1@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
    >
    >
    >
    >
    >
    >
    >
    >

    John Knoop Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139