You are on page 1of 6

Asp.

net control

Asp.net supports control

Both client side and server side and script both client side and server side
asp.net control

client side control

html control

Server side control


Html control at server
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm5.aspx.cs" Inherits="asp3.WebForm5"
%>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script runat="server">
void disp(object oo,EventArgs ee)
{
Response.Write("html button at server side with c# method");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" value="ok" runat="server" onserverclick="disp" />

</div>
</form>
</body>
</html>

Webcontrol

With .net library

System.web.ui.webcontrol

textbox,radiobutton,checkbox, and others control class


<asp:Button ID="btn" runat="server" Text="ok" OnClick="abc" />
-----
Asp tagprefix

Button tagname as class name with properties(text,forecolor,backcolore,height,title and others) and events(onclick and
others)

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm6.aspx.cs" Inherits="asp3.WebForm6"


%>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script runat="server">
void abc(object oo,EventArgs eee)
{
Response.Write("hello");
}
</script>
<script>
function abc() {
alert('client');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btn" runat="server" Text="ok" OnClick="abc" />
<asp:Button ID="btn2" runat="server" Text="ok1" OnClientClick="abc();" />
</div>
</form>
</body>
</html>

You might also like