objectdatasource parameter value from application

G

Guest

Can anyone tell me is there an easy way to get a value into an
objectdatasource select parameter from Application Variables? Obviously its
easy from cookies, session etc... but what about Application? Or is there an
easy way to get a value into an objectdatasource parameter from the
web.config? Kind of like how we get the connection string from web.config
into a datasource object, like:

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$
ConnectionStrings:spg_portalsConnectionString %>"

Can I do:

<SelectParameters>
<asp:parameter Name="dept_id" DefaultValue="<%$ AppSettings:dept %>
</SelectParameters>
 
G

Guest

I didn't try what you have mentioned, but I tried to set parameter value from
code
like this:
ObjectDataSource1.SelectParameters["Param1"].DefaultValue =variable;
I used to do that in Page_Load event and it works fine.
--
Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
 

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

Forum statistics

Threads
473,781
Messages
2,569,616
Members
45,304
Latest member
CalmwellCBDIngredients

Latest Threads

Top