Net Pract 1-4
Net Pract 1-4
Aim: Write a program to check whether empty Query String is entered in Asp.net
Code:
using System;
namespace QueryStrng
{
public partial class FirstPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e) { }
protected void sendBTN_Click(object sender, EventArgs e)
{
Response.Redirect("SecondPage.aspx?name=" + txtTB.Text.Trim());
}
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SecondPage.aspx.cs"
Inherits="QueryStrng.SecondPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:Label ID="txtLBL2" runat="server"></asp:Label>
</form>
</body>
</html>
SecondPage.aspx.cs
using System;
namespace QueryStrng{
public partial class SecondPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(Request.QueryString["name"].ToString()))
txtLBL2.Text = "QueryString is empty !!"; else
{
string str = Request.QueryString["name"].ToString();
txtLBL2.Text = "QueryString is not empty and value is " + str.ToString();
}
}
}
}
Output:-
Case 1:
Case 2:
:
Practical No.2
Aim: Write a program to change the color of label text control programmatically in Asp.net
Code:
Aim: Write a program to Enable-Disable Textbox and also change width of Textbox
programmatically in Asp.net
Code:
Case 1:
Case 2:
Practical No.4
Aim: Write a program to increase and decrease font size programmatically in Asp.net
Code:
Case 1:
Case 2:
Index