Can I (declaratively) use a form property or variable as a data source parameter?

Y

yeltsin27

I can see how to use a cookie, control property, form input value,
profile, query string or session value as a parameter to a SQL Data
Source.

However I would like to use a property that is declared on the page
(which as it happens is persised in VIEWSTATE).

I know I could write the property to a control, but that's no different
to writing the value to the ControlParameter, which is what I'm doing
now.

Using a property declaratively seems an obvious thing to want to do.
Can I do it, and if so how?

Thanks,

Chris N.

P.S. When would I use a form parameter rather than a control property,
except in the (unusual?) case where that form parameter was not exposed
via a control?
 
M

Mikeon

I can see how to use a cookie, control property, form input value,
profile, query string or session value as a parameter to a SQL Data
Source.

However I would like to use a property that is declared on the page
(which as it happens is persised in VIEWSTATE).

I know I could write the property to a control, but that's no different
to writing the value to the ControlParameter, which is what I'm doing
now.

Using a property declaratively seems an obvious thing to want to do.
Can I do it, and if so how?

Actually You can do it.
Check it out here:
http://vaultofthoughts.net/ProblemsWithDataSourceControls.aspx

Note that you wont get designer support for this as described in the
article. I use this technique and so far I cannot complain :).
P.S. When would I use a form parameter rather than a control property,
except in the (unusual?) case where that form parameter was not exposed
via a control?

I don't know if I understand, but I use page as parameters for data
source controls very often.
Also if you prefer working with objects rather than datasets, check my
object data source control - it will make your life a lot easier:
http://vaultofthoughts.net/ObjectDataSourceAWorkingAlternative.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top