இந்த வீடியோவில்
ASP.NET பேசிக் டூலான பட்டன் அதன் வகைகள்,அதன் ப்ரொபர்டீஸ்,மெத்தட்ஸ்,ஈவென்ட்ஸ் பற்றி
காண இருக்கின்றோம்,.
SOURCE
CODING:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="textboxdemo.WebForm2" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="credit" runat="server" CommandArgument="100" CommandName="credit" OnCommand="credit_Command" Text="Credit" />
<br />
<br />
<br />
<asp:Button ID="Debit" runat="server" CommandArgument="100" CommandName="Debit" OnCommand="credit_Command" Text="Debit" />
<br />
<br />
<br />
<asp:Label ID="lbloutput" runat="server" Text="500"></asp:Label>
</div>
</form>
</body>
</html>
protected void credit_Command(object sender, CommandEventArgs e)
{
int intAmt;
intAmt = int.Parse(e.CommandArgument.ToString());
if (e.CommandName == "credit")
{
lbloutput.Text = (int.Parse(lbloutput.Text) +
intAmt).ToString();
}
else
{
lbloutput.Text = (int.Parse(lbloutput.Text) -
intAmt).ToString();
}
}
Example:2
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="textboxdemo.WebForm3" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">LinkButton</asp:LinkButton>
<br />
<br />
<asp:ImageButton ID="ImageButton1" runat="server" Height="110px" ImageUrl="~/asp.jpg" OnClick="ImageButton1_Click" Width="201px" />
<br />
<br />
<br />
<br />
<asp:Label ID="lbloutput" runat="server" Text="--"></asp:Label>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace textboxdemo
{
public partial class WebForm3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
lbloutput.Text = "you clicked link button";
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
lbloutput.Text = "you clicked image button";
}
}
}
இதன் அடுத்த பகுதி நாளை வெளியாகும்.
No comments:
Post a Comment