How To Use DataGrid in ASP.NET with Example with DataTable
code , Example Of DataGrid , code For DataGrid in Website ,How to Use DataGrid In Websites, Website code for DataGrid use .
Example :
WebControls.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebControls.aspx.cs"
Inherits="WebFormsControlls.WebControls" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="labelId" runat="server">User Name</asp:Label>
<asp:TextBox ID="UserName" runat="server" ToolTip="Enter User Name"></asp:TextBox>
</div>
<p>
<asp:Button ID="SubmitButton" runat="server" Text="Submit" OnClick="SubmitButton_Click" />
</p>
<br />
</form>
<asp:Label ID="userInput" runat="server"></asp:Label>
</body>
</html>
Code Behind
WebControls.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebFormsControlls
{
public partial class WebControls : System.Web.UI.Page
{
protected void SubmitButton_Click(object sender, EventArgs e)
{
userInput.Text = UserName.Text;
}
}
}
code , Example Of DataGrid , code For DataGrid in Website ,How to Use DataGrid In Websites, Website code for DataGrid use .
Example :
WebControls.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebControls.aspx.cs"
Inherits="WebFormsControlls.WebControls" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="labelId" runat="server">User Name</asp:Label>
<asp:TextBox ID="UserName" runat="server" ToolTip="Enter User Name"></asp:TextBox>
</div>
<p>
<asp:Button ID="SubmitButton" runat="server" Text="Submit" OnClick="SubmitButton_Click" />
</p>
<br />
</form>
<asp:Label ID="userInput" runat="server"></asp:Label>
</body>
</html>
Code Behind
WebControls.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebFormsControlls
{
public partial class WebControls : System.Web.UI.Page
{
protected void SubmitButton_Click(object sender, EventArgs e)
{
userInput.Text = UserName.Text;
}
}
}
Post a Comment