Add rows to datatable after page post back

  • Thread starter Thread starter srinivas
  • Start date Start date
S

srinivas

HI,

I have 4 text boxes and one button in my page. When ever I
fill the text boxes and click the button the data should be add to a
datagrid with out inserting a record in database. For this I used
datatable to insert the records but when ever I click the add button my
aspx page is submitting. When page submits new datatable instance is
creating and I lost old data. How can we keep old rows and ad new
datarow in data table. Sorry for my english. Please help me in this
regard


Thanks in advance

-- srinivas
 
If you don't want to reload the table, you should make it persistent. You
can do it in a session variable. IsPostBack property tells you if you are in
a postback that you will know you need to restore the datatable from the
session variable rather that load it from the database.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
Back
Top