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
Bonnie SmithPosted Oct 11, 2010, 3:23 PM
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
Suthish NairPosted Oct 11, 2010, 2:21 PM
Bonnie SmithPosted Oct 11, 2010, 9:29 AM
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
Bonnie SmithPosted Oct 11, 2010, 9:21 AM
Bonnie
Suthish NairPosted Oct 9, 2010, 4:06 PM
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;
}
}
Sam HobbsPosted Oct 8, 2010, 6:39 PM