Drop Down Menu / Posts /

Menu reloads everytime

6
Why does the menu reload everytime that I click a link on the menu? For example when I click, "Color picker" the menu blinks in and out. It seems rather tacky for the menu to be designed this way...
Dan  5 years ago   viewed: 9931    

9 Answers

1
Because the link you clicked is a link and it navigates to a new page. If you don't like this, you can search for an Ajax solution.
Milo   5 years ago
0

 I am using a database driven menu for navigating to different pages. Is there a way to avoid reloading of the menu every time a page is called. I tried different method but all of them makes call to database everytime

My first try was as a usercontrol. Inside the usercontrol I had the menu. I had the menu databind inside a !(IsPostBack) condition, but still it kept binding itself. I tried binding it on onnit event too. My second attempt was on masterpages. I had the menu in masterpage and it kept binding the menu everytime a page is requested or a post back is made.The third try was  using an interface which I extended like this on the partial class definition

public partial class Order_Query_Report : System.Web.UI.Page, CustomParent.IPageToIncludeHeaderFooter

The header was coming through that interface which internally contains a usercontrol (which in turn contains the menu).

None of them helped me to achieve what I was looking for.

Another approach was to have two iframes and having header on top and content on bottom. I had the menu fire javascripts in order to load the pages on bottom iframe. But it had significant drawbacks. The URL on top of browser is always constant (the url of header). Secondly, there were lots of issues in terms of authentication, disconnected communication etc.

It will be great if someone can advice me how to achieve a header menu which doesn't rebind everytime.

I tried ajax , but that also didn't help.Every time there' s a redirect, the menu binds itself


simon katich
  4 years ago
0

This can be resolved by the server side programming. For example, you can store the database data into a server side cache, then serve the request with the server side cached data.

For example, the following .NET MVC code is to get the product categories from the server cache :

public static List ProductCategories_Cached { get { if ((List)(HttpContext.Current.Cache["Cache:ProductCategory"]) == null) { using (myEntities db = new myEntities()) { List staticData = db.ProductCodes.ToList(); HttpContext.Current.Cache.Insert("Cache:ProductCode", staticData, null, DateTime.MaxValue, TimeSpan.FromDays(1), CacheItemPriority.High, null); } } return (List)(HttpContext.Current.Cache["Cache:ProductCode"]); } } public static ProductCategory GetProductCategories(string pCode) { return ProductCategories_Cached.FirstOrDefault(p => p.Pcode == pCode); }
Milo   4 years ago
0

good..

<a href="https://www.wikitechy.com/hosting/chile/web-hosting"> chile web hosting</a>

<a href="https://www.wikitechy.com/hosting/colombia/web-hosting">colombia web hosting</a>

<a href="https://www.wikitechy.com/hosting/croatia/web-hosting">croatia web hosting</a>

<a href="https://www.wikitechy.com/hosting/cyprus/web-hosting">cyprus web hosting</a>

<a href="https://www.wikitechy.com/hosting/dominican-republic/web-hosting/hosting/bahrain/web-hosting">bahrain web hosting</a>

<a href="https://www.wikitechy.com/hosting/dominican-republic/web-hosting/hosting/india/web-hosting">india web hosting</a>

<a href="https://www.wikitechy.com/hosting/dominican-republic/web-hosting/hosting/iran/web-hosting">iran web hosting</a>

<a href="https://www.wikitechy.com/hosting/dominican-republic/web-hosting/hosting/kazakhstan/web-hosting">kazakhastan web hosting</a>

<a href="https://www.wikitechy.com/hosting/dominican-republic/web-hosting/hosting/korea/web-hosting">korea web hosting</a>

<a href="https://www.wikitechy.com/hosting/dominican-republic/web-hosting/hosting/moldova/web-hosting">moldova web hosting</a>


rajan
  one month ago
0

Usually, when I run into a situation like this - where the items in the menu arent going to change very often - I set up a small caching utility, to perform and hold the dataset for the menu's information, and bind to the class - rather than directly to the database.  Just store the returned dataset inside a CacheObject, then before your menu checks it, find out if the CacheObject is empty, if it is fill it, then bind to it, if it's not empty, use whats in it. 

This will keep you from making calls to the Database every single time the menu is hit, and it'll perform MUCH better for you.

"sel.options.length = 0;\n";

 

greenbergmethew
  4 years ago
0

Nice Post...I have learn some new information.thanks for sharing.
https://www.excelr.com/data-science-course-training-in-bangalore

seoexpert
  4 months ago
0

Excellent post...

<a href="https://www.inplanttrainingchennai.com/">inplant training in chennai</a>

<a href="https://www.kaashivinfotech.com/inplant-training-in-chennai">inplant training in chennai</a>

<a href="https://www.kaashivinfotech.com/inplant-training-in-chennai-for-it/">inplant training in chennai for it</a>

<a href="https://www.wikitechy.com/hosting/australia">Australia hosting</a>

<a href="https://www.wikitechy.com/hosting/mexico/web-hosting">mexico web hosting</a>

<a href="https://www.wikitechy.com/hosting/moldova/web-hosting">moldova web hosting</a>

<a href="https://www.wikitechy.com/hosting/albania/web-hosting">albania web hosting</a>

<a href="https://www.wikitechy.com/hosting/andorra">andorra hosting</a>

<a href="https://www.wikitechy.com/hosting/australia/web-hosting">australia web hosting</a>

<a href="https://www.wikitechy.com/hosting/denmark/web-hosting">denmark web hosting</a>


Dras
  29 days ago
0

Excellent post... very useful 

<a href="https://www.kaashivinfotech.com/python-training-in-chennai/">python training in chennai</a>

<a href="https://www.kaashivinfotech.com/internship-for-cse-students-in-hyderabad/">internships in hyderabad for cse 2nd year students</a>

<a href="https://www.kaashivinfotech.com/inplant-training-for-cse-students/">online inplant training</a>

<a href="https://www.kaashivinfotech.com/internship-for-aeronautical-engineering-students/">internships for aeronautical engineering students</a>

<a href="https://www.kaashivinfotech.com/internship/">kaashiv infotech internship review</a>

<a href="https://www.kaashivinfotech.com/cpp-internship/">report of summer internship in c++</a>

<a href="https://www.kaashivinfotech.com/internship-for-cse-students-in-hyderabad/">cse internships in hyderabad</a>

<a href="https://www.kaashivinfotech.com/python-internship/">python internship</a>

<a href="https://www.kaashivinfotech.com/internship-for-civil-students/">internship for civil engineering students in chennai</a>

<a href="https://www.kaashivinfotech.com/robotics-training-in-chennai/">robotics course in chennai</a>


dras   25 days ago
0

nice.....

<a href="https://www.kaashivinfotech.com/internship-for-aeronautical-engineering-students/">aeronautical internship in india</a>

<a href="https://www.kaashivinfotech.com/internship-in-chennai-for-mechanical/">free internship in chennai for mechanical engineering student</a>

<a href="https://www.kaashivinfotech.com/tag/list-of-architectural-firms-in-chennai-for-internship/">architectural firms in chennai for internship</a>

<a href="https://www.kaashivinfotech.com/internship-for-eee-students/">internship in coimbatore for eee</a>

<a href="https://www.kaashivinfotech.com/internship-for-cse-students/">online internships for cse students</a>

<a href="https://www.kaashivinfotech.com/internship-for-mechanical-students/">mechanical internship certificate</a>

<a href="https://www.kaashivinfotech.com/inplant-training-report-for-civil-engineering-students/">inplant training report</a>

<a href="https://www.kaashivinfotech.com/internship-for-cse-students-in-hyderabad/">internships in hyderabad for cse</a>

<a href="https://www.kaashivinfotech.com/internship-for-mba-students/">internship for mba students in chennai</a>

<a href="https://www.kaashivinfotech.com/internship-for-cse-students/">internship in trichy for cse</a>

reena
  23 days ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: