I have a page that contains a drop down list populated with report names of rdl files. This is not an items list, it is dynamically created with the report names that a certain user is able to access after authentication. What I need to do is redirect from one page to a particular item from the ddl. I have tried setting a Session variable & checking for that when reloading the reports page, but it will not load the report I want. here is the code on the reports page:
if(Session["session"] != null) {
for (int i = 0; i < ddl.Item.Count; i++) {
if(ddl.Items[i].Value == "12") {
ddl.SelectedIndex = i;
break;
}
any suggestions are helpful.
thanks
Bonnie
Loading

Sam HobbsRank #108 · 20.5K reputationPosted Oct 8, 2010, 2:39 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Oct 9, 2010, 12:06 PM EDT
Am not sure about your post. Hoping, after your authentication you want to load the report from dropdown. Try like this..
if(Session["session"] != null){
if (ddl.Items.FindByValue("12")) == null == false)
{
ddl.SelectedValue = "12";
ddl_SelectedIndexChanged(e, e);
break;
}
}
Bonnie Smith9 reputationPosted Oct 11, 2010, 5:21 AM EDT
Bonnie
Bonnie Smith9 reputationPosted Oct 11, 2010, 5:29 AM EDT
thank you for looking at my post. I realized that I did not post the end of the code. Here it is:
if(Session["session"] != null) {
for (int i = 0; i < ddl.Item.Count; i++) {
if(ddl.Items[i].Value == "12") {
ddl.SelectedIndex = i;
break;}
}
ddl_SelectedIndexChanged();
Session["session"] = null;}
Again, thanks for looking. Maybe this will help.
Bonnie
Suthish NairRank #92 · 22.8K reputationPosted Oct 11, 2010, 10:21 AM EDT
Bonnie Smith9 reputationPosted Oct 11, 2010, 11:23 AM EDT
I did try as you suggested, but it did not work in my example. I also built a test application not using the rdl report names (using collection of items) and used your example & my original as well. Both instances worked in the test app. It seems that my project, which unfortunately I cannot debug locally (due to server permissions in the company I contract for), cannot determine the value of the rdl reports. any suggestions?
thanks
Bonnie