I have a list, thats built based on some files, when the page builds up.
There is a save button next to each other.
Its pretty straightforward at this point..
Works great as long as the file-list remains the same.
The problem is, these files sometimes get deleted in the background, and whenever I press one of the save buttons,
- it first rebuilds the whole page
- then runs the button's code
This is a never-ending problem to me occasionally, since I came from the WinForms world, and i just would like to run the code, without causing a whole page-rebuild..
Anarkin
Member
16 Points
21 Posts
ASP.NET, Postback, Button
Jul 29, 2012 03:30 PM|LINK
Hi,
I have a list, thats built based on some files, when the page builds up.
There is a save button next to each other.
Its pretty straightforward at this point..
Works great as long as the file-list remains the same.
The problem is, these files sometimes get deleted in the background, and whenever I press one of the save buttons,
- it first rebuilds the whole page
- then runs the button's code
This is a never-ending problem to me occasionally, since I came from the WinForms world, and i just would like to run the code, without causing a whole page-rebuild..
Thanks !
Ajay2707
Contributor
4483 Points
868 Posts
Re: ASP.NET, Postback, Button
Jul 29, 2012 03:58 PM|LINK
Hi Anarkin,
As you new in this part. I give suggestion that all the code which you need to at the first time of page load.
use IsPostBack Property of page, Which solve the problem of postback.
refer link.
<div class="f kv">http://msdn.microsoft.com/en-us/library/system.web.ui.page.ispostback.aspx</div>http://www.codeproject.com/Articles/68371/Detecting-Refresh-or-Postback-in-ASP-NET