[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Basic C# commands?

Posted on 2007-10-05
6
Medium Priority
?
1,547 Views
Last Modified: 2013-12-17
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!
0
Comment
Question by:StrategicGnomer
  • 3
  • 3
6 Comments
 
LVL 5

Expert Comment

by:Colemss
ID: 20025425
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
 

Author Comment

by:StrategicGnomer
ID: 20025520
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
 

Author Comment

by:StrategicGnomer
ID: 20025533
oh snap, forgot to mention, using asp.net 2.0 with visual studio 2005 and i'm using c# as the default language
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:Colemss
ID: 20025542
I figured that from all the system.web usings
0
 
LVL 5

Accepted Solution

by:
Colemss earned 2000 total points
ID: 20025551
0
 

Author Comment

by:StrategicGnomer
ID: 20025613
that is exactly what i was looking for thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question