Basic C# commands?

I'm learning C# to do a project and hopefully a job but I have no knowledge in it at all so I'm just trying to do a few things to get started, first, let's say I have a button on the page and I want it to link somewhere, what's the command to link to a web page? and secondly, anyone know of a good way to learn some basics? a good book, a good video training thing etc? Thanks!
StrategicGnomerAsked:
Who is Participating?
 
ColemssConnect With a Mentor Commented:
0
 
ColemssCommented:
Sam learning in 30 days.
Excelent how to and free
http://www.csharp-station.com/

add the button double click it to open the coding page and create the click event and click method


// <summary>
/// Opens a new Internet Explorer window and navigates it to the URL.
/// This code is for demonstration purposes only.
/// </summary>
/// <param name="sURL">URL to navigate to.</param>
/// <returns>true all the time.</returns>
public static bool IEOpenOnURL (string sURL)
{
      InternetExplorer oIE = (InternetExplorer)NSLibStatic.COMCreateObject
                                                      ("InternetExplorer.Application");

      if (oIE != null)
      {      
            object oEmpty = String.Empty;
            object oURL= sURL;
            oIE.Visible = true;
            oIE.Navigate2 (ref oURL, ref oEmpty, ref oEmpty, ref oEmpty, ref oEmpty);
      }
      return true;                  
}

call like this

    IEOpenURL ("http://www.NovickSoftware.com");
0
 
StrategicGnomerAuthor Commented:
not sure if i got this right, here's what I got...

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public static bool IEOpenOnURL(string sURL)
    {
        InternetExplorer oIE = (InternetExplorer)NSLibStatic.COMCreateObject
                                                        ("InternetExplorer.Application");

        if (oIE != null)
        {
            object oEmpty = String.Empty;
            object oURL = sURL;
            oIE.Visible = true;
            oIE.Navigate2(ref oURL, ref oEmpty, ref oEmpty, ref oEmpty, ref oEmpty);
        }
        return true;
    }
   
    protected void Button1_Click(object sender, EventArgs e)
    {
        IEOpenURL("http://www.yahoo.com");
    }
}
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
StrategicGnomerAuthor Commented:
oh snap, forgot to mention, using asp.net 2.0 with visual studio 2005 and i'm using c# as the default language
0
 
ColemssCommented:
I figured that from all the system.web usings
0
 
StrategicGnomerAuthor Commented:
that is exactly what i was looking for thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.