asp.net 1.1 event handlers

Hi

How to debug asp.net 1.1 application. I worked on asp.net 2.0 and later but not with asp.net 1.1 in VS 2003. I just placed button and textbox on ui and in button click handler, i am assigning random text. But when i select the button, i am seeing blank page. why so?  what is different in running asp.net 1.1 and 2.0

below is code.

-------------------------------
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication2.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
      <HEAD>
            <title>WebForm1</title>
            <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
            <meta name="CODE_LANGUAGE" Content="C#">
            <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">
                  <asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 200px; POSITION: absolute; TOP: 120px"
                        runat="server"></asp:TextBox>
                  <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 248px; POSITION: absolute; TOP: 216px" runat="server"
                        Text="Button"></asp:Button>
            </form>
      </body>
</HTML>

--------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace WebApplication2
{
      /// <summary>
      /// Summary description for WebForm1.
      /// </summary>
      public class WebForm1 : System.Web.UI.Page
      {
            protected System.Web.UI.WebControls.TextBox TextBox1;
            protected System.Web.UI.WebControls.Button Button1;
      
            private void Page_Load(object sender, System.EventArgs e)
            {
                  // Put user code to initialize the page here
            }

            #region Web Form Designer generated code
            override protected void OnInit(EventArgs e)
            {
                  //
                  // CODEGEN: This call is required by the ASP.NET Web Form Designer.
                  //
                  InitializeComponent();
                  base.OnInit(e);
            }
            
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {    
                  this.Button1.Click += new System.EventHandler(this.Button1_Click);
                  this.Load += new System.EventHandler(this.Page_Load);

            }
            #endregion

            private void Button1_Click(object sender, System.EventArgs e)
            {
                  TextBox1.Text="foo";
            }
      }
}


Thank You,
Naresh
sangeetaandkarthikAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Easwaran ParamasivamCommented:
Button click event causes postback. At that time the page load event is called. In page load event the text is not being set. Hence you are not able to see the value. Use the code to set the value correctly.

You can use some other options as well such as setting value in client side using Javascript and EnableViewState=true to the textbox control.

private void Page_Load(object sender, System.EventArgs e)
   {
       if(Page.IsPostBack)
       {
           TextBox1.Text="foo";
       }

    }

Open in new window

0
kovilpattiBaluCommented:
hi,

In IIS change the virtual directory framework to point to 2.0.50707 in ASP.net tab.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GlobaLevelProgrammerCommented:
in addition to the above, I was also expecting, an on_click in your asp tag:

chage this :
       <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 248px; POSITION: absolute; TOP: 216px" runat="server"
                        Text="Button"></asp:Button>

to this:

       <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 248px; POSITION: absolute; TOP: 216px" runat="server"
                        Text="Button" OnClick="Button1_Click" ></asp:Button>


to reference this in your code behind:
        private void Button1_Click(object sender, System.EventArgs e)
            {
                  TextBox1.Text="foo";
            }
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.