Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data binding not working
Message
 
À
24/08/2011 08:31:37
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 4.0
OS:
Windows Server 2003
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01521648
Message ID:
01521798
Vues:
32
Hi Tim,
I figured out a few things but still can't get everything to work right. I have code in the Text_Changed event, which is triggering a post back (because the user has to press ENTER to get it to fire) with no place to update my session dataset variables. Consequently, I get an extra trip to the back end before saving my data set variables and lose everything that was just entered. I disabled the submit for all but one of my buttons except for a save button, hoping to route all the submits through there so I could update the session variables in the click event of the button but that apparently fires after the submit as well. Then I tried saving the session variables in the unload of that button, hoping the dataset variables would save right before posting but still no luck. Next I plan to abandon the Text_Changed event and put all the code I want either in the page load or in that button click.
Basically, my problem is that the users want the responsiveness of the desktop environment but management wants everything on the web so they can get to the data (users are widely distributed) and, probably, keep the cost of the user computers down. I lost the fight trying to convince them to stick with Windows Forms for this application, at least for now.
I haven't really looked at Silverlight. What would that gain me in this process?
Thanks, as always, for your help.
Linda

>Hi Linda,
>
>>I am working on a web application after several years away from the web, so for all practical purposes, I am a newbie. I have set up my form with the default settings, as described in the JumpStart. Perhaps I don't understand how this was meant to work but I expected that, unless I specifically issued a save, there would not be a postback. I am getting a postback for each data field and, worse yet, the value entered in the control is not sticking, although values that I enter programmatically are sticking. I have checked, double-checked, triple-checked, etc. to make sure that I have the BindingSource and BindingSourceMember set correctly. The value isn't even showing up in the dataset when I check it in the TextChanged event.
>>
>>I'm probably missing something obvious but can't see any difference between what I have and what's in the jumpstart. Any ideas for where to start looking? Thanks.
>
>Since the web stuff is static and once the page is loaded the business objects and everything else goes away. Are you instantiating your business objects in the Page Load event so they get done every time? Are you re-retrieving data every time the page posts back? What I often do depending on what is the data; I will save a copy of the DataSet in a session variable. Check out the jump start for Web Forms Step 12 for the Order Edit Form. The data is retrieved and saved in a session for the order and detail but the Shippers and Employees are retrieved every time a post back occurs. This should give you some ideas on what you may want to do.
>
>I am not sure I follow the Post Back for each data field however. Are you saying you get a seperate post back for each field that is saved even when you only initiate a single save?
>
>Welcome back to the web. It is some of the more frustrating work I have done due to the static nature and difficult to control positioning. Are you sure you don't want to be doing Silverlight? :-) Or maybe you are.
>Timothy
Linda Harmes
HiBit Technologies, Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform