0% found this document useful (0 votes)
73 views

Exercise1

Uploaded by

asaithambiasdf71
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

Exercise1

Uploaded by

asaithambiasdf71
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1. Design ASP.

Net web form using Html Server Controls to enter job seeker’s
detail.
JobSeekerForm.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JobSeekerForm.aspx.cs"
Inherits="JobPortal.JobSeekerForm" %>
<!DOCTYPE html>
<html>
<head runat="server">
< tle>Job Seeker Details</ tle>
</head>
<body>
<form id="jobSeekerForm" runat="server">
<h1>Job Seeker Details Form</h1>
<table>
<tr>
<td><label for="txtName">Full Name:</label></td>
<td>
<input type="text" id="txtName" runat="server" placeholder="Enter your full name" />
</td>
</tr>
<tr>
<td><label for="txtEmail">Email Address:</label></td>
<td>
<input type="email" id="txtEmail" runat="server" placeholder="Enter your email" />
</td>
</tr>
<tr>
<td><label for="txtPhone">Phone Number:</label></td>
<td>
<input type="text" id="txtPhone" runat="server" placeholder="Enter your phone
number" />
</td>
</tr>
<tr>
<td><label for="txtQualifica on">Highest Qualifica on:</label></td>
<td>
<input type="text" id="txtQualifica on" runat="server" placeholder="Enter your
qualifica on" />
</td>
</tr>
<tr>
<td><label for="txtExperience">Years of Experience:</label></td>
<td>
<input type="text" id="txtExperience" runat="server" placeholder="Enter experience in
years" />
</td>
</tr>
<tr>
<td><label for="ddlJobCategory">Job Category:</label></td>
<td>
<select id="ddlJobCategory" runat="server">
<op on value="IT">IT</op on>
<op on value="Healthcare">Healthcare</op on>
<op on value="Educa on">Educa on</op on>
<op on value="Finance">Finance</op on>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<bu on type="submit" id="btnSubmit" runat="server"
onserverclick="SubmitForm">Submit</bu on>
<bu on type="reset" id="btnReset" runat="server" onserverclick=" ResetForm
">Reset</bu on>
</td>
</tr>
</table>
</form>
</body>
</html>

JobSeekerForm.aspx.cs

using System;
using System.Web.UI;

namespace JobPortal
{
public par al class JobSeekerForm : Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Page load logic, if needed
}

protected void SubmitForm(object sender, EventArgs e)


{
// Retrieve the form values
string name = txtName.Value;
string email = txtEmail.Value;
string phone = txtPhone.Value;
string qualifica on = txtQualifica on.Value;
string experience = txtExperience.Value;
string jobCategory = ddlJobCategory.Value;
// Store the data or display a message
Response.Write($"<h3>Form submi ed successfully!</h3>");
Response.Write($"<p>Name: {name}</p>");
Response.Write($"<p>Email: {email}</p>");
Response.Write($"<p>Phone: {phone}</p>");
Response.Write($"<p>Qualifica on: {qualifica on}</p>");
Response.Write($"<p>Experience: {experience}</p>");
Response.Write($"<p>Job Category: {jobCategory}</p>");
}
protected void ResetForm(object sender, EventArgs e)
{
// Reset all form fields to their default values
txtName.Value = string.Empty;
txtEmail.Value = string.Empty;
txtPhone.Value = string.Empty;
txtQualifica on.Value = string.Empty;
txtExperience.Value = string.Empty;
ddlJobCategory.SelectedIndex = 0; // Reset to the first op on
}
}
}

Output

You might also like