0

I created an asp:table which store dynamic controls (label, dropdownlist, button). When I click on a button, an event fired and I lose data because of the postback.

private void buildTab(){
foreach(Article a in tabDatas){
TableRow tr = new TableRow;

...

Button b = new Button();
b.OnClick += new EventHandler(buttonUpdate_Click);

...

tab.Rows.Add(tr);
}
}

I work on VS 2008 and I can't use AjaxControlToolkit.

My question is : How to update just the row who fired the event and not entirely the tab ? I think I've to use Ajax but I have no idea how do this.

Thanks for your advice.

Anthony VINEE
  • 67
  • 2
  • 10
  • you should read a bit on this stack overflow question to understand what a post back is http://stackoverflow.com/questions/4251157/what-is-a-postback Furthermore you should realise that any form submit action is causing a full page reload thus you lose the data. The only way to achieve the post back is as you mentioned ajax. I guess another question to help you: http://stackoverflow.com/questions/28782928/asp-net-5-mvc-6-ajax-post-model-to-controller – czioutas Jan 25 '16 at 08:40
  • Thx, I'll see those posts. – Anthony VINEE Jan 25 '16 at 08:43

0 Answers0