在ASP.NET中加载内容页面加载主页面 [英] Master page load on content page load in ASP.NET

查看:74
本文介绍了在ASP.NET中加载内容页面加载主页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生/女士,



我正在使用c#在asp.net上开发一个网站。我有一个10内容页面和一个母版页面。我的问题是每当我点击内容页面的菜单按钮时,我的内容页面正在加载,这很好,但为什么我的母版页正在加载。加载会减慢我的网站内容页面加载速度,因为我在母版页加载事件中有4到5种方法。



我尝试过:



我用google搜索它并发现主页面会在内容页面后加载,但我想阻止加载我该怎么办。我也使用了更新面板,但没有发生任何新的事情。

解决方案

这就是母版页的工作方式。内容页面被注入母版页并作为一个页面发送到客户端。即使网址仅指向内容页面,主页面和内容页面也会与每个页面一起执行。



如果您的母版页很慢渲染然后也许你可以使用某种缓存加速它,这取决于它的主页是什么慢。


Sir/Madam,

I am developing a website in asp.net with c#. I have a 10 content page and a master page. My problem is whenever i click menu button for content page that time my content page is loading that's fine but why my master page is loading . That loading slow up my website to content page loading because i have 4 to 5 methods in master page load event.

What I have tried:

I have googled it and find that master page will load at last after content page but i want prevent that load how can i do . I also used update panel in that but doesn't happened anything new .

解决方案

That's how master pages work. The content page is injected into the master page and sent to the client as one page. The master page and content page are both executed\rendered with every page even though the url is only pointing to the content page.

If your master page is slow to render then maybe you can use caching of some sort to speed it up, it depends on what it is about the master page that is slow.


这篇关于在ASP.NET中加载内容页面加载主页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆