views:

511

answers:

1

how i return a value from javascript function to a c# variable (in controller)

and also i have a multicolum dropdown box in a form , eg book details , when the user makes the selection the book name is set in the dropdown , but when submit is hit i want the code book to be returned(this value is returned by my javascript) for billing purpose , in short for a test box i want to set a display value visible to the user and original value that is returned from the form ?

i read about ajax postback , that you could send data from client to server ??

+3  A: 

You're best bet is to set values on appropriately named hidden text inputs. That way, the model can be updated by the post action, which keeps the architecture simple.

Sohnee
That's what I use and it works pretty well.
GoodEnough