Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 11th, 2005, 04:45 PM
Registered User
 
Join Date: Feb 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to goldablasha
Default can't change label's property on webForm!

hi everyone,

i created an ASP.NET web application and on the webForm i dragged a label, which i was trying do change the text property calling the
Page_Load() function, but doesn't work. I think it's not even executing this code. If anyone could help!

namespace Weblog1
{
  /// <summary>
  /// Summary description for WebForm1.
  /// </summary>
  public class WebForm1 : System.Web.UI.Page
  {
      protected System.Web.UI.WebControls.Label Label1;

      private void Page_Load(object sender, System.EventArgs e)
      {
      Label1.Text = "Label's text changed!";
      }
  }
}

thanks to all!
 
Old February 12th, 2005, 02:57 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

are you sure somewhere like InitializeComponent() you attach your Page_Load function?
Code:
this.Load += new System.EventHandler(this.Page_Load);
(sometime VS.NET doesn't attach delegates).

_____________
Mehdi.
software student.
 
Old February 14th, 2005, 12:26 AM
Registered User
 
Join Date: Feb 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to goldablasha
Default

its ok, i made it work. Thanks for the help anyway!





Similar Threads
Thread Thread Starter Forum Replies Last Post
change TextBox.BackColor property onFocus event drasko ASP.NET 1.0 and 1.1 Basics 8 January 26th, 2009 12:23 AM
Webform listbox databinding to any property Rachel P VS.NET 2002/2003 0 October 1st, 2005 10:11 PM
Webform listbox control databing to any property Rachel P Classic ASP Basics 2 October 1st, 2005 10:01 PM
Change Buttons Enabled property from another frame TappeBoy VS.NET 2002/2003 7 October 25th, 2004 02:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.