M
Mark C
I have been playing with Visual Studio and trying to learn it. I am creating a simple web application with a web form named WebForm1.aspx (using defaults). I placed Label and Button from the Web Forms section of the toolbox. I double clicked the button to get the code behind event for the button onclick event. I assign the value of "Hello World" (real basic stuff) to the label text property. After building and browsing all I see is the Label. The button does not display. If I add an HTML button it displays, but I can't add any code to it. I am running on XP Pro, Visual Studio Enterprise Edition. I am attaching my code below, but I can't figure out why this doesn't work. (I took it from a training manual that is step by step.) IIS is running on my machine as far as I can tell
Thanks in advance for any clarification
// Cod
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 MyFirstWebApplicationC
/// <summary
/// Summary description for WebForm1
/// </summary
public class WebForm1 : System.Web.UI.Pag
protected System.Web.UI.WebControls.Label lblMessage
protected System.Web.UI.WebControls.Button Button1
private void Page_Load(object sender, System.EventArgs e
// Put user code to initialize the page her
#region Web Form Designer generated cod
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 modif
/// 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)
#endregio
private void Button1_Click(object sender, System.EventArgs e
lblMessage.Text = "Hello World!"
Thanks in advance for any clarification
// Cod
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 MyFirstWebApplicationC
/// <summary
/// Summary description for WebForm1
/// </summary
public class WebForm1 : System.Web.UI.Pag
protected System.Web.UI.WebControls.Label lblMessage
protected System.Web.UI.WebControls.Button Button1
private void Page_Load(object sender, System.EventArgs e
// Put user code to initialize the page her
#region Web Form Designer generated cod
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 modif
/// 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)
#endregio
private void Button1_Click(object sender, System.EventArgs e
lblMessage.Text = "Hello World!"