sangeetaandkarthik
asked on
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_defaultClientScri pt" 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:TextB ox>
<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.B utton1_Cli ck);
this.Load += new System.EventHandler(this.P age_Load);
}
#endregion
private void Button1_Click(object sender, System.EventArgs e)
{
TextBox1.Text="foo";
}
}
}
Thank You,
Naresh
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.
<!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_defaultClientScri
<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:TextB
<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.
protected System.Web.UI.WebControls.
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.B
this.Load += new System.EventHandler(this.P
}
#endregion
private void Button1_Click(object sender, System.EventArgs e)
{
TextBox1.Text="foo";
}
}
}
Thank You,
Naresh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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";
}
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";
}
You can use some other options as well such as setting value in client side using Javascript and EnableViewState=true to the textbox control.
Open in new window