HTML Server Controls in ASP.Net Assignment Help

Assignment Help: >> ASP.Net Programming >> HTML Server Controls in ASP.Net

HTML Server Controls in ASP.Net:

The HTML server controls are mainly the real HTML controls but activated to enable server side processing. The HTML controls like the anchor tags, header tags and input component are not operated by the server but sent to the browser for display.

They are specifically related to a server control by including the attribute runat="server" and including an id attribute to prepare them available for server-side processing.

For example, takes the HTML input control:

<input type="text" size="40">

It should be changed to a server control, by including the runat and id attribute:

<input type="text" id="testtext" size="40" runat="server">

Advantages of using HTML Server Controls

Although ASP.Net server controls may adds every job related by the HTML server controls, the later controls are needful in the given cases:

  • Using static tables for layout functions
  • Changing a HTML page to run under ASP.Net

The following table defines the HTML server controls:

Control Name

HTML tag

HtmlHead

<head>element

HtmlInputButton

<input type=button|submit|reset>

HtmlInputCheckbox

<input type=checkbox>

HtmlInputFile

<input type = file>

HtmlInputHidden

<input type = hidden>

HtmlInputImage

<input type = image>

HtmlInputPassword

<input type = password>

HtmlInputRadioButton

<input type = radio>

HtmlInputReset

<input type = reset>

HtmlText

<input type = text|password>

HtmlImage

<img> element

HtmlLink

<link> element

HtmlAnchor

<a> element

HtmlButton

<button> element

HtmlButton

<button> element

HtmlForm

<form> element

HtmlTable

<table> element

HtmlTableCell

<td> and <th>

HtmlTableRow

<tr> element

HtmlTitle

<title> element

HtmlSelect

<select> element

HtmlGenericControl

All HTML controls not listed

Example:

The given example uses a basic HTML table for layout. It needs some text boxes for saving input from the users like, city, state, name, address etc. It also has a button, which is pressed to get the user data shown on the last row of the table.

The page could look like this in the design view:

1323_html control.png

The code for the content page indicates the use of the HTML table element for layout.

<%@ Page Language="C#" AutoEventWireup="true"

                       CodeBehind="Default.aspx.cs"

                       Inherits="htmlserver._Default" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="https://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Untitled Page</title>

<style type="text/css">

   .style1

   { 

       width: 156px;

   }

   .style2

   {

      width: 332px;

   }

</style>

</head>

<body>

<form id="form1" runat="server">

<div>

<table style="width: 54%;">

<tr>

<td class="style1">Name:</td>

<td class="style2">

<asp:TextBox ID="txtname" runat="server" Width="230px">

</asp:TextBox>

</td>

</tr>

<tr>

<td class="style1">Street</td>

<td class="style2">

<asp:TextBox ID="txtstreet" runat="server" Width="230px">

</asp:TextBox>

</td>

</tr>

<tr>

<td class="style1">City</td>

<td class="style2">

<asp:TextBox ID="txtcity" runat="server" Width="230px">

</asp:TextBox>

</td>

</tr>

<tr>

<td class="style1">State</td>

<td class="style2">

<asp:TextBox ID="txtstate" runat="server" Width="230px">

</asp:TextBox>

</td>

</tr>

<tr>

<td class="style1"> </td>

<td class="style2"></td>

</tr>

<tr>

<td class="style1"></td>

<td ID="displayrow" runat ="server" class="style2">

</td>

</tr>

</table>

</div>

<asp:Button ID="Button1" runat="server"

            onclick="Button1_Click" Text="Click" />

</form>

</body>

</html>

The code behind the button control:

protected void Button1_Click(object sender, EventArgs e)

{

        string str = "";

        str += txtname.Text + "<br />";

        str += txtstreet.Text + "<br />";

        str += txtcity.Text + "<br />";

        str += txtstate.Text + "<br />";

        displayrow.InnerHtml = str;

}

observe the followings

  • The basic HTML tags has been used for the page layout.
  • The last part of the HTML table is used for data display. It required server side processing, so an ID attribute and the runat attribute has been included to it.

 

Email based ASP.Net assignment help - homework help at Expertsmind

Are you searching ASP.Net expert for help with HTML Server Controls in ASP.Net questions?  HTML Server Controls in ASP.Net topic is not easier to learn without external help?  We at www.expertsmind.com offer finest service of ASP.Net assignment help and ASP.Net homework help. Live tutors are available for 24x7 hours helping students in their HTML Server Controls in ASP.Net related problems. Computer science programming assignments help making life easy for students. We provide step by step HTML Server Controls in ASP.Net question's answers with 100% plagiarism free content. We prepare quality content and notes for HTML Server Controls in ASP.Net topic under ASP.Net theory and study material. These are avail for subscribed users and they can get advantages anytime.

Why Expertsmind for assignment help

  1. Higher degree holder and experienced experts network
  2. Punctuality and responsibility of work
  3. Quality solution with 100% plagiarism free answers
  4. Time on Delivery
  5. Privacy of information and details
  6. Excellence in solving ASP.Net queries in excels and word format.
  7. Best tutoring assistance 24x7 hours

 

 

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd