Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmTextBox reverts back to zero
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01296241
Message ID:
01298311
Views:
25
Bob,

>I have an mmTextBox placed on a web form and have bound it to a business object column using the bindingsource and bindingsourcemember properties. I also have a button next to this control with the following event code:
>
>
>// Create a new trader profit record
>        TraderprofitDefaults TPD = new TraderprofitDefaults(this.profitID, Convert.ToInt32(this.cboTrader.SelectedValue));
>        this.oTraderProfit.NewEntity(TPD);
>        if (mmSaveDataResult.RulesPassed == this.oTraderProfit.SaveEntity())
>        {
>            string nextScreen = "ProfitEditForm.aspx?profitID=" + this.profitID.ToString();
>            mmMessageDisplay.DisplayMessage("System Confirmation", "Trader Allocation Record Successfully Saved",
>                nextScreen, 3);
>        }
>
>
>The code is to add a new row into the trader profit table. This table has three columns. The two referenced above as default values and the third the value in the mmTextBox that is entered by the user (before the button is clicked to add the row).
>
>My problem is that the value entered in the text box is lost each time I click the button as it reverts back to zero. Can anyone help me to explain what is happening here?

I recommend setting a breakpoint in mmTextBox.BindBack() to see what's going on. When the web form is posted back, the text box should contain the value entered by the user (make sure you haven't turned off view state for this control).

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
Reply
Map
View

Click here to load this message in the networking platform