Gridview and DatasourceID

H

hfritz

Hallo,

in the DefaultPage.aspx I set the department information to
sessionvariable (DEP1, DEP2 ...). I want to use this department
information to bind it to the Gridview-datasourceID on 10 other pages.

I need to do this, because every department has its own Database to
store documentinfomations, with the same tabledesign. Know I want to
build an webapplication with only one webpage per table over all
Databases where I get the information from.

I tryed the followig, but it doesen´t work:

<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True"
DataSourceId="<%$
session("SqlDataSource_name")%>" ....
How can I reference to the session variable?

thank you for every Idee
Harald
 
K

KJ

You can set the datasourceid at runtime.

Alternatively, have you tried <%= Session("SqlDataSource_name")%>
(untested)
 

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

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top