.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

how to maintain state in menu control in asp.net 4.0

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :ASP.Net


I am working  on vs. 2010. I have menu control in master page.

my menu having two pages  default1.aspx, default2.aspx .

when user enter some values in default1.aspx page after click default2.aspx and enter some  values

now  if I click default1.apx page doesn't having values. but i want  to maintain those values  in my all pages .


Could any body help me on this requirement.




View Complete Post

More Related Resource Links

Custom Server Control Property not maintaining state


I have created a server control consisting of a TextArea and a div under it.  My goal is to create my own asp:TextArea type control.  the div is for a Character count of the text area and seems to work ok but i added a CharacterCountVisible property to the control that is always returning true.  See Proptery definition below


<Bindable(False), Category("Appearance"), DefaultValue("True"), Localizable(True)> Property CharacterCountVisible() As Boolean
        Return _CountBoxVisible
    End Get
    Set(ByVal value As Boolean)
        _CountBoxVisible = value
    End Set
End Property

Note the _CountBoxVisible variable is define inside the class as :

Dim _CountBoxVisible as Boolean = True

What I am trying to do is give the user/coder the option to show/utilize the char count feature.  Can make it disappear with textarea1.CharacterCountVisible = False but setting it to true will not make it display.


What am i missing





Dynamic menu control


Dear all,

I want to get the names of some folders in my drive and populate my menu control with the names of those folders.

Getting the folder names is not the issue, but how can i populate my menu with the names of getted foldernames.

I tried this:

DirectoryInfo dirInfo = new DirectoryInfo(Server.MapPath("~\\MyFolders\\"));
DirectoryInfo[] dirs = dirInfo.GetDirectories();
Menu1.DataSource = dirs;

But im getting the error:

HierarchicalDataBoundControl only accepts data sources that implement IHierarchicalDataSource or IHierarchicalEnumerable.


How can i achieve this?

Thanks in advance.


Menu Control


Hi all

Ive got a Menu Control linked to Web.sitemap but would like a step by step example of how

to make it look and behave like the one I found here:-



Is there somewhere I can download an example of this or one similar?




Menu items of Welcome control behaves incorrect in non-IE browsers.


We are using wss 3.0 sp2

I am referring to the welcome control that is part of standard sharepoint pages. This is the in the masterpage. The welcome contrrol has options such as 'sign-in as different user' , 'signout' and so on. When user takes the mouse and tries to click on the sub-menu it doesn't work as if the menu item is not getting focussed (however up/down arrow with keyboard works fine). 

I know that sharepoint sites are not best when viewed with firefox, safari, chrome etc  but is there a fix for this? Is it do with 'z' index setting or something? Can this be fixed through javascript?  

Please share your views/solution.


Menu control rendering issue with IE8



Using VS2010, I created an ASP.NET 4.0 web application and simply added a couple of menu items below the "Home" menu item in the master page that's created by the project wizard. I made no other changes - no code, no stylesheet changes.

If I run the app locally then everything is fine. I suspect because the local IIS is responsive enough for the problem not to occur.

If I deploy the app to a web host (discountasp.net) then I see the menu render vertically for less than a second before it renders correctly. If I refresh the page a few times then usually I can see the menu vertical flash but sometimes I can't, so there's some sort of timing consideration.

I'm using IE8. The problem doesn't seem to occur with either Firefox 3 or Chrome.

Have others seen this problem?

Any suggestions for a fix?

I can supply the zipped up project if anyone wants it.


problem with menu Control

i am using menu Control and i got a interesting think when i run it through right click and click view in browser then sub menu under menu id display but when i will run it through debug mode then only root is display sub menu is not display.why? 

How can I maintain "state" across WCF method calls?

I need to retrieve very large portions of NTFS files (as byte arrays) from a WCF Service.  The needed portions of the files are far too large to efficiently return in a single request, so I need a "chunky" implementation that will return just a portion of the file on each method call. But the entire process needs to be very fast... specifically: I need to avoid the overhead of re-opening the file each time the client requests the next "chunk". So how can I keep the filestream open on the service-side in anticipation of the next request from the client for the next chunk? And if no subsequent request arrives, then close the filestream? That is, implement "lazy close". Or stated another way: Does the code instantiated on the service-side to service an incoming method call remain "alive" after the method returns to the caller?  Or can it be configured that way, like a Singleton SAO behaves in Remoting?? Thanks, DT 

Maintain Controls State on Master Page.

I have Web Application which uses the Logged In User (Authenticated User) to query his Profile Data from Adabas/Unix using OLEDB. The application provides the user with about 21 different pages (Basic Info, Employment Info, Education, Dependants, Financial Info ...). The web application has a master page, and each profile data page is based on a User Control loaded in the Child ASPX Page. Since we are migrating our legacy applications from Adabas/Unix to SAP, the development Team has prepared web services to query for the same Profile Data from SAP using Web Services. Now, we have to modify the web application to consume the web services instead of using OLEDB to query Adabas. Since we are in the testing phase, and we have only very limited data in SAP, I have to provide temporary control to allow test query the Staff Profile for a Specified User (instead of the Authenticated User) and to select the Source: 1. SAP, or 2. Adabas.   So I am thinking to add the following "Control Section" in the Master Page:<div runat="server" id="divSAPTest" class="SAPTest"> <span>Test SAP Web Services. Enter Staff ID: </span> <asp:TextBox ID="txtSAPStaffID" runat="server" Width="60px"></asp:TextBox> <span>From: </span> <asp:DropDo

dynamic menu control call in login page

Hi ,i have declared two control in my master page , how wants to call this menu control in child page ( that is login page)i want to bind the menu control dynamically based on login previlagepublic Menu newMenu = new Menu();  public MenuItem newItem = new MenuItem("Master");

Menu Control expansion weired issue.

Menu control expands on load (vertically, 100%) and then contracts to its horizontal position. The code I am using- ASPX page: <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="False" IncludeStyleBlock="False" Orientation="Horizontal" DataSourceID="SiteMapDataSource1">                    <DynamicMenuStyle CssClass="DynamicMenu" /></asp:Menu>   CSS:  .DynamicMenu{ display: none;} This can be live at www.jaindata.com Can someone please help? Thanks, Swapneel Shah 

Accessing Session State in a User Control

We have a web site that implements a custom SiteMapProvider using a User Control added in the master page. I need to be able to limit the sitemap nodes added depending on the logged in user, that is, certain users should not see certain sitemap nodes. Currently, the login processing code determines if users are in the certain category or role and then sets a value in session state, for example, Session["UserInRoleXXX"] = "Yes"; I tried changing the code in the user control to check the session state, but I got the following error: NullReferenceException ... Object reference not set to an instance of an object." Can session state be accessed in a user control? If so, how? If not, any suggested solutions? Thanks in advance for any help.

The OTHER Menu control issue...

Ok, everyone knows that the z-index is messed up in IE8 and that requires patches or workarounds...What I can't seem to find a solution to is the white background on the DynamicMenu parts of a Menu control.  Setting the background color to transparent or not setting it all doesn't seem to have any effect.  This is only a problem in IE8, Firefox 3.6.8 renders the dynamic menus without the white background.

Problem with Asp:menu control in IE8

Hai friends, Here i am facing a new problem,i created a navigation page by using asp:menu control,and after when i viewed it in Internet explorer8, the SubMenu's are not displaying. But when i checked the Compatibility view button which is next ot Stop and Refresh Or in Tools->CompatabilityView. then it is displaying the submenus. The same problem exists in Google Chrome but not in FireFox Can any one tell me the solution how to view the submenus without changing the Compatability settings. Thanks Maniraju

ASP.NET menu control with CSS Friendly dll casuses slow rendring

I am using ASP.NET menu control  with CSS Friendly dll casuses slow rendring,Is there any way i can make little bit fast rendring?Thanks in advance

would like to put dealy on Menu control

I am using dhtml script from dyanamicdrive.com for Horizantal menu in web sites, On my menu link when I mouse over, I would like to put some delay before , it will show menu, can some one tell me how to do this?   thank you  

Get Rid of Triangle Image on Menu Control

Does anyone know how to get rid of the Triangle that appears on the menu control? I didn't see any properties mentioned in the tree/menu control article by microsoft(http://msdn.microsoft.com/asp.net/whidbey/default.aspx?pull=/library/en-us/dnvs05/html/treeview.asp). I currently do not have the Beta installed so I don't have the library of docs to check for additional properties. I just want to use an image in the top menu items and want each image to be directly next to each other (Horizontal Configuration) but the Black triangle is getting in the way. Besides actually deleting the image from the server is there a way to do this? Thanks! VC

Where to maintain state on server

Hi,I am developing a feature in my app where I need to store the state of a particular series of actions between 2 users, just like an ajax based chat service. Where do I store the state? Or taking the example of Ajax based chat, where should I store what message User1 entered and when Uer1 entered how is it shown to user2?I was thinking application object but read it is not recmmended. 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend