Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Button click event comes after GridView bind
Message
 
To
06/06/2011 12:52:15
Don Harris
Iu Athletics Computer Services
Indiana, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01513130
Message ID:
01513187
Views:
38
Don,

,
> 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.

In an ASP.NET app, when you click the button, the web form's Page_Load() fires first, and since you have clicked the button, IsPostBack is true, and your foreach loop executes. Next, your btnMoveToNewYear_Click() method fires and the code overwrites the EntityList you created in the page load.

Are you using the MM .NET data binding properties?

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform