Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Button click event comes after GridView bind
Message
De
06/06/2011 12:52:15
Don Harris
Iu Athletics Computer Services
Indiana, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Button click event comes after GridView bind
Divers
Thread ID:
01513130
Message ID:
01513130
Vues:
156
Hi all,
I don't know if this is because I'm binding to an entitylist or if it's something dumb I'm doing.

I have a button that triggers a search and then should populate a gridview with the entitylist of that search. However,
I cannot get it to bind to the data in the click event of the button. If I click the button, the first time through
nothing happens. If I click it the second time, it populates fine. The data is always one click behind the
button. As you can see I've tried binding and rebinding all over the place but I seem to be missing some
clue about the page life cycle or binding in general.

I'm also posting a link I found of someone having the same issue but the answers don't seem to be applying.
That's why I'm posting here. Is this something particular to mm.net?

I know I have to be missing something simple. Have to be.

Have a great day!

Don
         protected void Page_Load(object sender, EventArgs e)
         {

            if (IsPostBack)
            {
                foreach (string item in Session.Contents)
                {
                    switch (item)
                    {
                        case "CarryForwardIsYes":
                         this.oAthlEligibility0.EntityList = GetEntityListFromSession<AthlEligibilityEntity>("CarryForwardIsYes");
                         break;
                           ...
                     {
        
              }
 
           grdMovNxtYrYes.DataSource = this.oAthlEligibility0.EntityList;
           grdMovNxtYrYes.DataBind();
         }


       protected void btnMoveToNewYear_Click(object sender, EventArgs e)
        {
            string sourceyear = "2010";
            string targetyear = "2011";

            AthlEligMovStudToNewYr movRes = new AthlEligMovStudToNewYr(sourceyear, targetyear);
            this.oAthlEligibility0.EntityList = movRes.CarryForwardIsYes; 
 
             grdMovNxtYrYes.DataBind(); 
             grdMovNxtYrYes.Rebind();
             Page.DataBind();
            //shoot me!
  
         }


http://stackoverflow.com/questions/552000/asp-net-page-events-button-click-event-comes-after-gridview-bind
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform