Más contenido relacionado La actualidad más candente (20) Similar a HTML SERVER CONTROL - ASP.NET WITH C# (20) HTML SERVER CONTROL - ASP.NET WITH C#1. HTML SERVER CONTROLS – NITHIYAPRIYA PASAVARAJ Page 1
Home.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="home.aspx.cs" Inherits="home" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server" style="background-color: #99CC00; height: 510px;">
<div style="text-align: center">
HTML SERVER CONTROLS - EXAMPLE - JOB APPLICATION REGISTRATION
FORM</div>
<p>
</p>
<p style="height: 66px">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/jobs.aspx" style="text-align:
center; z-index: 1; left: 376px; top: 117px; position: absolute">Click here to Go to Registration
Page</asp:HyperLink>
</p>
</form>
</body>
</html>
Jobs.aspx
2. HTML SERVER CONTROLS – NITHIYAPRIYA PASAVARAJ Page 2
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="jobs.aspx.cs" Inherits="jobs" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body style="text-align: center">
<form id="form1" runat="server" enctype="multipart/form-data">
<div>
REGISTRATION FORM</div>
<table style="width:100%;" runat="server">
<tr>
<td class="auto-style1" style="text-align: right">FIREST NAME :</td>
<td style="text-align: left">
<input id="Text1" type="text" /></td>
</tr>
<tr>
<td class="auto-style1">LAST NAME</td>
<td style="text-align: left">
<input id="Text2" type="text" /></td>
</tr>
3. HTML SERVER CONTROLS – NITHIYAPRIYA PASAVARAJ Page 3
<tr>
<td class="auto-style1">USER NAME</td>
<td class="auto-style2">
<input id="Text3" type="text" /></td>
</tr>
<tr>
<td class="auto-style1">PASSWORD</td>
<td class="auto-style2">
<input id="Password1" type="password" /></td>
</tr>
<tr>
<td class="auto-style1">ADDRESS</td>
<td class="auto-style2">
<textarea id="TextArea1" name="S1"></textarea></td>
</tr>
<tr>
<td class="auto-style1">PHONE NO</td>
<td class="auto-style2">
<input id="Text4" type="text" /></td>
</tr>
<tr>
<td class="auto-style1">GENDER</td>
<td class="auto-style2">
<input id="Radio1" checked="true" name="R1" type="radio" value="V1" />
FEMALE
<input id="Radio2" checked="true" name="R1" type="radio" value="V1" />MALE</td>
</tr>
<tr>
<td class="auto-style1">QUALIFICATION</td>
<td class="auto-style2">UG
<input id="Checkbox1" type="checkbox" /> PG
<input id="Checkbox2" type="checkbox" /> M.Phil
<input id="Checkbox3" type="checkbox" /> P.hD
<input id="Checkbox4" type="checkbox" /></td>
</tr>
<tr>
<td class="auto-style1">Select Your Desire Job Location</td>
<td class="auto-style2">
<select id="Select1" name="D1" runat="server">
<option>Select</option>
<option>Chennai</option>
<option>Trichy</option>
<option>Coimbatore </option>
</select></td>
</tr>
<tr>
<td class="auto-style1">Upload Your Resume</td>
<td class="auto-style2">
<input type="file" name="FileUpload" />
<asp:Button ID="Button1" Text="Upload" runat="server" OnClick="Upload" />
<br />
4. HTML SERVER CONTROLS – NITHIYAPRIYA PASAVARAJ Page 4
<asp:Label ID = "lblMessage" Text="File uploaded successfully." runat="server" ForeColor="Green"
Visible="false" />
</td>
</tr>
<tr>
<td class="auto-style3"> </td>
<td class="auto-style2">
<input id="Submit1" type="submit" value="submit" runat="server" onserverclick="submit"
formmethod="get" />
<input id="Reset1" type="reset" value="reset" runat="server" />
</td>
</tr>
<tr>
<td class="auto-style3"> </td>
<td class="auto-style2">
</td>
</tr>
</table>
</form>
</body>
</html>
Jobs.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
public partial class jobs : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Upload(object sender, EventArgs e)
{
//Access the File using the Name of HTML INPUT File.
HttpPostedFile postedFile = Request.Files["FileUpload"];
//Check if File is available.
if (postedFile != null && postedFile.ContentLength > 0)
{
//Save the File.
5. HTML SERVER CONTROLS – NITHIYAPRIYA PASAVARAJ Page 5
string filePath = Server.MapPath("~/Uploads/") + Path.GetFileName(postedFile.FileName);
postedFile.SaveAs(filePath);
lblMessage.Visible = true;
}
}
protected void submit(object sender, EventArgs e)
{
Response.Redirect("jobs2.aspx");
}
}
Jobs2.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="jobs2.aspx.cs" Inherits="jobs2" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body style="text-align: center">
<form id="form1" runat="server">
<div>
6. HTML SERVER CONTROLS – NITHIYAPRIYA PASAVARAJ Page 6
<img alt="" src="uncommon-creative-bird-hd-wallpaper-high-resolution-image-creative-beautiful-
bird-hd-wallpaper-high-resolution-image-wallpapers-for-iphone-desktop-quality-with-quotes-facebook-
mobile-free-download-ideas.jpg" style="height: 194px; width: 252px" /><br />
<span class="auto-style1">Thanks for Registering on our Portal!!!</span></div>
</form>
<p>
</p>
</body>
</html>