Last post Mar 21, 2012 02:22 PM by SilV3RSix
Mar 21, 2012 01:57 PM|SilV3RSix|LINK
I'm setting up a simple (I thought) calculator app whereby a user enters some info into a form, and I calculate the rest of the parameters. I have two controller methods (shown below). Obviously, in this case, I am simply trying to hard change an attribute
and pass it to the appropriate view. The Views are just auto-generated Create and Edit views, respectively.
The DesignInput form is wired to call the DesignResult method, and this is, in fact, working. However, the 2nd attribute assignment never seems to update/override/replace the incoming attribute, so the Design Result View always displays the values input
in the Design Input View. How the bloody heck do I change those incoming values into something useful?
Function DesignInput() As ActionResult
Dim diffpair As DiffPair = New DiffPair
diffpair.CoaxImpedance = 10
Function DesignResult(diffpair As DiffPair) As ActionResult
'perform calculations here
diffpair.CoaxImpedance = 100
Mar 21, 2012 02:00 PM|ignatandrei|LINK
The posted parameters takes precedence over values set by you ( good for showing error when user put 'aaa' into an input corresponding to a numeric value)
Mar 21, 2012 02:22 PM|SilV3RSix|LINK
Wow. Simple fix. Thanks.
For reference, I just called ModelState.Clear() just to clean sweep the whole shootin' match.