I am binding to a table I created in my DNN database. The SQL is something like this:
SELECT This_ID, This_Name, This_Thing From This_Table WHERE This_ID = 22
I get 22 from $(DSParam1) in my Querystring. I am only pulling This_ID so I can set it to a hidden field and use it from there on out so someone doesn't spoof the form on submit and change the 22 to a 25 and update another row.
If I set the This_ID field to a TextBox, it sets the variable. If I set it to a Hidden Field, it doesnt set the variable until you edit your form and click submit to update the record. Obviously it throws a SQL error because SQL can't convert varchar to int (it is passing in $(This_ID) and not 22).
I hope that makes sense.
As a work around, I have the field as a TextBox and read only.
Why would it not set the field for a hidden field? Any suggestions?