GridView Selected Row Values in PreviousPage Avoid Page Refresh Using JavaScript Asp.Net C#.
First Form Select Some Gridview Rows After Go to Second Form . Next Click Back Button - Go Back to Previous Page Without Refreshing Gridview Rows Using JavaScript in Asp.Net C#.
Avoid page refresh in Gridview Update,Delete,Insert
Avoid page refresh in using Ajax UpdatePanel
DEMO
First - Add GridView - Bind Data Fields Temporery From ToolBox - Add Button For Next Page
Next - Add Another New Form - Button Added For Back Button
Next - Add - Script For Parent History Call
Next - First Form - Coding For GridView
Next- F5[Run] - Select Gridview Values - Send Another Page - Back To Previous Page
First Form Select Some Gridview Rows After Go to Second Form . Next Click Back Button - Go Back to Previous Page Without Refreshing Gridview Rows Using JavaScript in Asp.Net C#.
Avoid page refresh in Gridview Update,Delete,Insert
Avoid page refresh in using Ajax UpdatePanel
DEMO
HTML CODING Page 1
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table> <tr><td </td><td> <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" Height="150px" Width="200px" >
<AlternatingRowStyle BackColor="#FF9966" />
<Columns>
<asp:TemplateField HeaderText="SNO">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Sno") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="NAME">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CITY">
<EditItemTemplate>
<asp:TextBox ID="txtCtyUpdate" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("City") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Select">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Text="Click" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="#CC3300" />
<RowStyle BackColor="Silver" />
</asp:GridView>
</td></tr></table>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Go To Second Page" />
</div>
</form>
</body>
</html>
HTML CODING Page 1
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script type="text/javascript">
function goBack() {
window.history.back();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button5" runat="server" Text="Back" OnClientClick="history.back(-1)"/>
</div>
</form>
</body>
</html>
C# CODING
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class RemoveRow : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Bind();
}
}
protected void Bind()
{
DataTable dt = new DataTable();
dt.Columns.Add("Sno", typeof(string));
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("City", typeof(string));
dt.Rows.Add("1", "AAA", "Mumbai");
dt.Rows.Add("2", "BBB", "New Delhi");
dt.Rows.Add("3", "CCC", "Kolkata");
//dt.Rows.Add("4",
"DDD", "Chennai");
//dt.Rows.Add("5",
"EEE", "Bangalore");
Session["Detail"] = dt;
DataTable dt1 = (DataTable)Session["Detail"];
GridView2.DataSource = dt;
GridView2.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("SendMail.aspx");
}
}
First - Add GridView - Bind Data Fields Temporery From ToolBox - Add Button For Next Page
Next - Add Another New Form - Button Added For Back Button
Next - Add - Script For Parent History Call
Next - First Form - Coding For GridView
Next- F5[Run] - Select Gridview Values - Send Another Page - Back To Previous Page
0 comments:
Post a Comment