AWP Prac
AWP Prac
AWP Prac
/2a
CS file------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication9
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click1(object sender, EventArgs e)
{
//font style
if (CheckBox1.Checked==true)
{
Label1.Font.Bold = true;
}
else
{
Label1.Font.Bold = false;
}
if (CheckBox2.Checked == true)
{
Label1.Font.Italic = true;
}
else
{
Label1.Font.Italic = false;
}
if (CheckBox3.Checked == true)
{
Label1.Font.Underline = true;
}
else
{
Label1.Font.Underline = false;
}
//font color
if (RadioButton1.Checked == true)
{
Label1.ForeColor = System.Drawing.Color.Red;
}
else if(RadioButton2.Checked == true)
{
Label1.ForeColor = System.Drawing.Color.Green;
}
else if(RadioButton3.Checked == true)
{
Label1.ForeColor = System.Drawing.Color.Blue;
}
//Font Family
Label1.Font.Name = DropDownList1.SelectedItem.Text;
//Font size
if(Int32.Parse(TextBox1.Text)>0)
{
Label1.Font.Size = FontUnit.Point(Int32.Parse(TextBox1.Text));
}
}
}
}
2. 1
CS file
using System;
namespace WebApplication9
{
public partial class WebForm2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
5.
6.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class WebForm2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
Calendar1.SelectedDates.Clear();
}
}
}
7.
First select User form (add new)
Then drag to Aspx file
namespace WebApplication3
{
public partial class WebUserControl1 : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
5.
Aspx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DLLClassLibrary1
{
public class Class1
{
public string Factorial(string num)
{
int fact = 1;
int n1 = Convert.ToInt32(num);
for (int i = 1; i <= n1; i++)
{
fact = fact * i;
}
num = Convert.ToString(fact);
return num;
}
}
}
DLL
using DLLClassLibrary1;
namespace WebApplication5
{
public partial class WebForm1 : System.Web.UI.Page
{
Class1 c = new Class1();
protected void Page_Load(object sender, EventArgs e)
{
}