Related Links

Masterpage to Default

Hello I have a pretty simple code that sends session variables to a Default Page and that page takes the session variables and populates a gridview based on a sqldatasource but it doesnt seem to be working. Absolutely nothing happens when you click on a
date.

Re: Masterpage to Default

The menus are supposed to be visible and the Masterpage sends the Default page the two sesssion variables those two session variables are then used in the sqldatasource to load the gridview. I didnt think I needed any code on the Default page except for
the sqldatasource(Working) and the gridview binded.

Re: Masterpage to Default

Re: Masterpage to Default

First, the masterpage isn't sending anything to the default page, it just sets a session variable which could be viewed anywhere.

Your menus aren't going to be visible from the code you mention because right after you set their visibility, you do a redirect. That basically sets them back to the original condition. You would need to set another session variable to say if they should
be visible or not and set the menus in the masterpage based upon the session variable to control them. So in essence, your code is working, but since you redirect immediately after making things visible, the settings are back to their original state.

Don't forget to mark useful responses as Answer if they helped you towards a solution.

Re: Masterpage to Default

Re: Masterpage to Default

As pointed out by others, you’re doing a redirect to another page after setting the menu to visible. This will revert the menu’s Visible property to its original state. So if you set its Visible to false in the markup, it will remain invisible. The workflow
is:

Calendar1_SelectionChanged1 is invoked
You set menu’s Visible to true
You do a redirect
The markup of your master page is parsed
In the markup, you set menu’s Visible to false

In the end, the menu is invisible.

I would like to suggest you to put the code setting menu’s Visible in OnLoad on the second page instead of the SelectionChanged event handler. That essentially adds another step to the above workflow:

In OnLoad of the second page, you set the menu’s Visible to true

Best Regards,

Ming Xu.

Please mark the replies as answers if they help or unmark if not.
Feedback to us

Re: Masterpage to Default

Code_warriors

Boy do I miss the good old days of asp.net.

To troubleshoot this issue, we really need the source code to reproduce the problem, so that we can investigate the issue in house. It is not necessary that you send out the complete source of your project. We just need a simplest sample to reproduce the
problem. You can remove any confidential information or business logic from it. Then we can find the issue more conveniently and provide further suggestions for you.
I would recommend that you can use
Windows Live SkyDrive to share the sample project.

Best Regards,

Ming Xu.

Please mark the replies as answers if they help or unmark if not.
Feedback to us