CopyPastor

Detecting plagiarism made easy.

Score: 0.7622644305229187; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2018-07-26
by Gauravsa

Original Post

Original - Posted on 2013-03-28
by tgolisch



            
Present in both answers; Present only in the new answer; Present only in the old answer;

You just have to wrap the code in `Page_Load` in a `!Page.IsPostBack`-check:
protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { // code here that should be executed only at the first time // and not on consecutive postbacks } }
As suggested, you can also try `AppendDataBoundItems`
Use Page.IsPostback() in your aspx code (server-side). Like this:
private void Page_Load() { if (!IsPostBack) { // the code that only needs to run once goes here } }
This code will only run the *first* time the page is loaded and avoids stepping on user-entered changes to the form.

        
Present in both answers; Present only in the new answer; Present only in the old answer;