I am writing following code:
namespace WebApplication5
{
public partial class WebForm1 : System.Web.UI.Page
{
private DataSet dataset1 = new Data
I suggest please use ViewState
as Session
will consume lot of server memory, though you can use any one of them to solve the purpose.
I don't think button1's event handler is doing anything apart from creating ds. So only one event handler will solve the purpose.
Another way to access ds in both the event handlers without losing data is declare ds as static
. But this mechanism does not suit this scenario.