Beruflich Dokumente
Kultur Dokumente
Aim:-Create Web Form to demonstrate use of the LinkLabel Control for navigating a user from
one page to another page
Source code:-
using System;
using System.Drawing;
using System.Windows.Forms;
[STAThread]
Application.Run(new Form1());
public Form1()
this.linkLabel1.LinkClicked += new
System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
// Set up how the form should be displayed and add the controls to the form.
this.linkLabel1.LinkVisited = true;
// Navigate to a URL.
System.Diagnostics.Process.Start("http://www.microsoft.com");
}
out put:
Aim:-Write a program to display two textboxes to accept username and password, if username is “abcdef”
and password is “12345”, then redirect The page to another page, else give an error message as “Incorrect
username and password
Source code:-
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsControlLibrary1
public UserControl1()
InitializeComponent();
return pPassword.Equals("secret");
// Event Handlers.
if (txtnam.Text.Length == 0)
return;
else
errorpro.SetError(txtnam,"");
stbMessage.Text = "";
// Password Validation
if (txtpw.Text.Length == 0)
return;
}
else
errorpro.SetError(txtpw,"");
stbMessage.Text = "";
// Check Password
if (LoginCheck(txtnam.Text, txtpw.Text))
if (SuccessfullyLogin != null)
else
if (LoginFail != null)
}
}
get
return lblname.Text;
set
lblname.Text = value;
get
return lbpwd.Text;
set
lbpwd.Text = value;
}
get
return btnlg.Text;
set
btnlg.Text = value;
[Browsable(false)]
set
txtnam.Text = value;
}
// Read-Only Property for Password
[Browsable(false)]
set
txtpw.Text = value;
Output :-
Example2:-
Aim:-Navigate the Web form from one page to theanother by Clicking on the ImageButton control.
Source code:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class buttons : System.Web.UI.Page
TextBox1.Text="keep smiling";
Output:-