Display current date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm very new to Visual C# .NET and would appreciate any help. I am using
Visual Studio .NET 2003. I want to display the current date from the user
system in a web form. I have spent hours searching for help using google but
with no success. It was recommended I display the date using a label but
cannot seem to create the correct code. Can someone help me?

Thank You
 
Is this correct?
public class cert : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
private void LoadInfo()
{
this.Label1.Text = DateTime.Now.ToString();
}
 
working now, thank you for your help

Bill Burke said:
Is this correct?
public class cert : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
private void LoadInfo()
{
this.Label1.Text = DateTime.Now.ToString();
}
 
This will display date and Time at the label...

How should I do if I only want to display date in a textbox?

Like 5/17/2005 ?


Cheers!

CLaudi
 
Back
Top