gridview inserting textbox
what is this error plz explain




Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sanjeeb LenkaPosted Aug 31, 2013, 1:05 AM
refer to this link.
http://www.aspsnippets.com/Articles/Add-new-Row-to-GridView-on-Button-Click-in-ASPNet.aspx
Safeer SafeerPosted Aug 31, 2013, 12:34 AM
Sanjeeb LenkaPosted Aug 31, 2013, 12:28 AM
What is the work of insert button as you are storing the data in database on save button click.
plz provide clear details.
Safeer SafeerPosted Aug 30, 2013, 11:27 PM
Safeer SafeerPosted Aug 30, 2013, 11:22 PM
Safeer SafeerPosted Aug 30, 2013, 11:21 PM
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
.cs
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dt = new DataTable();
dt.Rows.Add();
gvname.DataSource = dt;
gvname.DataBind();
}
}
protected void btnsave_Click(object sender, EventArgs e)
{
sp ps = new sp();
info nameinfo = new info();
foreach (GridViewRow row in gvname.Rows)
{
TextBox txtname = ((TextBox)row.FindControl("txtname"));
TextBox txtplace = ((TextBox)row.FindControl("txtplace"));
nameinfo.Name=txtname.Text;
nameinfo.place=txtplace.Text;
ps.NameAdd(nameinfo);
}
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
}
}
Sanjeeb LenkaPosted Aug 30, 2013, 3:02 AM
plz share your aspx.