czeuch
Posts: 16
|
Posted: 07/08/2006, 3:09 PM |
|
Hello, Iīm trying to fill a hidden input when the OnValidate event is launched. The hidden input is named customer and the record (form) is named Customers1.
Customers1customer.Value = Session("customer_id")
(Variable "Customers1customer" is not declared)
Iīve tryied this:
customer.Value = Session("customer_id")
but the CCS didnīt recognized Session sintax (Variable "Session" is not declared). What Iīve to do to correctly fill a hidden input at the OnValidate event?
Thanks!
|
|
|
peterr
Posts: 5971
|
Posted: 07/08/2006, 3:15 PM |
|
Session("customer_id") doesn't look like .NET syntax. You would need to write code in the programming language that you are using.
Also see http://forums.codecharge.com/search.php?s_keyword=HttpC...m[]=8&s_period=
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
czeuch
Posts: 16
|
Posted: 07/08/2006, 3:19 PM |
|
Session("customer_id") works perfectly on the BeforeShow event. But at the OnValidate event, it doesnīt work.
|
|
|
peterr
Posts: 5971
|
Posted: 07/08/2006, 4:17 PM |
|
OK, but you wrote that the .NET engine didn't recognize your syntax in "On Validate". The session syntax used by others at http://forums.codecharge.com/search.php?s_keyword=HttpC...m[]=8&s_period= works OK in "On Validate" event. So why not use it... ?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
czeuch
Posts: 16
|
Posted: 07/08/2006, 4:39 PM |
|
HttpContext.Current.Session("customer_id"). This is the correct syntax. But the line
customer.Value = HttpContext.Current.Session("customer_id")
doesnīt work. It gives no error, but the customer input is Required = True, and the record returns an error (The value of field Customer is required!). Itīs seems that the OnValidate isnīt filling correctly the customer input. Weird.
Thanks!
|
|
|
peterr
Posts: 5971
|
Posted: 07/08/2006, 4:48 PM |
|
Looking at the code, the "On Validate" event happens right after errors.Add , so it's too late to change the value at that time. You can probably add your code in the white area before the validation routine, after the Customers1 class.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|