Add rows to datatable after page post back

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
 
E

Eliyahu Goldin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top