Weitere ähnliche Inhalte
Ähnlich wie Html server control - ASP. NET with c# (20)
Mehr von priya Nithya (17)
Kürzlich hochgeladen (20)
Html server control - ASP. NET with c#
- 1. Nithiyapriya Pasavaraj Page 1
HTML SERVER CONTROL
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;”>
HTML SERVER CONTROLS – EXAMPLE – JOB APPLICATION REGISTRATION FORM
<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
<%@ 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”>
REGISTRATION FORM
<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>
- 2. Nithiyapriya Pasavaraj Page 2
</tr>
<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 />
<asp:Label ID = “lblMessage” Text=”File uploaded successfully.” runat=”server” ForeColor=”Green”
Visible=”false” />
</td>
</tr>
- 3. Nithiyapriya Pasavaraj Page 3
<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;
- 4. Nithiyapriya Pasavaraj Page 4
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.
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”>
Thanks for Registering on our Portal!!!
</form>
<p>
</p>
</body>
</html>