Practical 1.: Design

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Practical 1. Working with basic c# and ASP.

NET
b) Create an application to demonstrate string operations.

Design:-

String.aspx

Code:-

String.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class String : System.Web.UI.Page


{
protected void TextBox1_TextChanged(object sender, EventArgs e)
{

}
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string str1;
str1 = TextBox1.Text;
string[] words = str1.Split();
for (int i = 0; i < words.Length; i++)
{
TextBox2.Text = TextBox2.Text + words[i] + "\r\n";
}
}
protected void Button2_Click(object sender, EventArgs e)
{
string str1, str2;
str1 = TextBox1.Text;
str2 = str1.ToUpper();
TextBox2.Text = str2;
}
protected void Button3_Click(object sender, EventArgs e)
{
string str1, str2;
str1 = TextBox1.Text;
str2 = str1.ToLower();
TextBox2.Text = str2;
}
}

Output:-

You might also like