2关于在主页面上使用AJAX的问题 [英] 2 Questions about using AJAX with Master Page

查看:53
本文介绍了2关于在主页面上使用AJAX的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




尝试创建一个包含菜单的母版页,菜单在网站的页面之间切换

。 2问题是:


a。当我从一个页面导航到另一个页面(所有AJAX Web窗体,主页

页面作为他们的主...)时,整个页面都会刷新 - 还有菜单

属于大师,我该如何解决呢 - 所以只有内部内容才会刷新?


b。当我尝试在页面中创建一个启用了AJAX的控件时,我收到一个错误 - 要么我没有脚本管理器(这是

位于主页面btw)或 - 如果我添加一个脚本管理器 - 我有

1太多了......

所以 - 我该死的如果我这样做,该死的,如果我不... ... b $ b我怎么能创建一个只更新自己的控件(它是一堆

组合框彼此依赖)并把它放在那种网页上?


谢谢,


Dani

Hi,

Trying to create a master page that holds a menu, and the menu switches
between pages in the site. 2 problem arrosed:

a. When I navigate from page to page (all AJAX Web Forms, with the Master
pages as their master...) the entire page is refreshed - also the menu which
belongs to the master, how can I fix it - so only the inside content will be
refreshed ?

b. When I try to put an AJAX enabled control that I''ve created inside one of
the page, I get an error - either I don''t have a Script manager (which is
located on the master page btw) or - if I add a script manager - that I have
1 too many...
so - I damned if I do and damned if I don''t...

how can I create a control that only updates itself (it''s a bunch of
comboboxes depends on each other) and put it in that kind of web page ?

Thanks,

Dani

推荐答案

" Dani" < Da ** @ discuss.microsoft.com写信息

news:93 ************************** ******** @ microsof t.com ...
"Dani" <Da**@discussions.microsoft.comwrote in message
news:93**********************************@microsof t.com...

尝试创建一个包含菜单的母版页,菜单切换
网站页面之间的
。 2问题arrose:


a。当我从一个页面导航到另一个页面(所有AJAX Web窗体,主页

页面作为他们的主...)时,整个页面都会刷新 - 也是菜单



属于主人,我该如何解决呢 - 所以只有内部内容才能获得
刷新?
Trying to create a master page that holds a menu, and the menu switches
between pages in the site. 2 problem arrose:

a. When I navigate from page to page (all AJAX Web Forms, with the Master
pages as their master...) the entire page is refreshed - also the menu
which
belongs to the master, how can I fix it - so only the inside content will
be
refreshed ?



我恐怕你已经制作了经典字样。新手对MasterPages的误解

他们在某种程度上是ASP.NET等效的框架集。他们什么都不是像块集一样的b $ b。事实上,MasterPage只不过是一种特殊的用户控件。当请求内容页面时,它会加载它与它自己的标记合并的主页控件,并创建一个

页面。每次都会发生这种情况这就是MasterPages的工作原理......

I''m afraid you''ve made the "classic" newbie misconception about MasterPages
that they are somehow the ASP.NET equivalent of framesets. They are nothing
at all like framesets. In fact, a MasterPage is nothing more than a special
kind of UserControl. When a content page is requested, it loads its
MasterPage control which it merges with its own markup and creates a single
page. This happens every time. That''s how MasterPages work...


b。当我尝试将一个启用了AJAX的控件放在页面的一个页面上时,我得到一个错误 - 要么我没有脚本管理器(位于主页上的
顺便说一句)或者 - 如果我添加一个脚本管理器 - 那我也是b $ b还有

1很多......

所以 - 如果我这样做我该死的,该死的,如果我不... ... b $ b
b. When I try to put an AJAX enabled control that I''ve created inside one
of
the page, I get an error - either I don''t have a Script manager (which is
located on the master page btw) or - if I add a script manager - that I
have
1 too many...
so - I damned if I do and damned if I don''t...

http://aspalliance.com/1285_Tip_and_...Master_Pages.5

-

Mark Rae

ASP.NET MVP
http:/ /www.markrae.net

http://aspalliance.com/1285_Tip_and_...Master_Pages.5
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


感谢您的快速回复。

是否有好字样写一个使用母版页的网站的方式并没有
每次都重新加载菜单?

Dani

" Mark Rae [MVP]"写道:
Thanks for the quick reply.
Is there a "Good" way to write a site that uses a master page and doesn''t
make the menu reload every time ?
Dani
"Mark Rae [MVP]" wrote:

" Dani" < Da ** @ discuss.microsoft.com写信息

news:93 ************************** ******** @ microsof t.com ...
"Dani" <Da**@discussions.microsoft.comwrote in message
news:93**********************************@microsof t.com...

尝试创建一个包含菜单的母版页,菜单切换
网站页面之间的
。 2问题arrose:


a。当我从一个页面导航到另一个页面(所有AJAX Web窗体,主页

页面作为他们的主...)时,整个页面都会刷新 - 也是菜单



属于主人,我该如何解决呢 - 所以只有内部内容才能获得
刷新?
Trying to create a master page that holds a menu, and the menu switches
between pages in the site. 2 problem arrose:

a. When I navigate from page to page (all AJAX Web Forms, with the Master
pages as their master...) the entire page is refreshed - also the menu
which
belongs to the master, how can I fix it - so only the inside content will
be
refreshed ?



我恐怕你已经制作了经典字样。新手对MasterPages的误解

他们在某种程度上是ASP.NET等效的框架集。他们什么都不是像块集一样的b $ b。事实上,MasterPage只不过是一种特殊的用户控件。当请求内容页面时,它会加载它与它自己的标记合并的主页控件,并创建一个

页面。每次都会发生这种情况这就是MasterPages的工作原理......


I''m afraid you''ve made the "classic" newbie misconception about MasterPages
that they are somehow the ASP.NET equivalent of framesets. They are nothing
at all like framesets. In fact, a MasterPage is nothing more than a special
kind of UserControl. When a content page is requested, it loads its
MasterPage control which it merges with its own markup and creates a single
page. This happens every time. That''s how MasterPages work...


b。当我尝试将一个启用了AJAX的控件放在页面的一个页面上时,我得到一个错误 - 要么我没有脚本管理器(位于主页上的
顺便说一句)或者 - 如果我添加一个脚本管理器 - 那我也是b $ b还有

1很多......

所以 - 如果我这样做我该死的,该死的,如果我不... ... b $ b
b. When I try to put an AJAX enabled control that I''ve created inside one
of
the page, I get an error - either I don''t have a Script manager (which is
located on the master page btw) or - if I add a script manager - that I
have
1 too many...
so - I damned if I do and damned if I don''t...


http://aspalliance.com/1285_Tip_and_...Master_Pages.5


-

Mark Rae

ASP.NET MVP
http://www.markrae.net


http://aspalliance.com/1285_Tip_and_...Master_Pages.5
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


" Dani" < Da ** @ discussion.microsoft.com写信息

news:69 ************************** ******** @ microsof t.com ...

[top-posting更正]
"Dani" <Da**@discussions.microsoft.comwrote in message
news:69**********************************@microsof t.com...

[top-posting corrected]

>> a。当我从一个页面导航到另一个页面(所有AJAX Web窗体,以
主页面作为他们的主页......)时,整个页面都会刷新 - 同样属于主页的菜单
,我该如何修复它 - 所以只有内部的内容会被刷新?
>>a. When I navigate from page to page (all AJAX Web Forms, with the
Master
pages as their master...) the entire page is refreshed - also the menu
which belongs to the master, how can I fix it - so only the inside
content will
be refreshed ?


我担心你已经制作了经典字样。新手对MasterPages的误解
他们在某种程度上是ASP.NET等效的框架集。它们根本不像
一样。事实上,MasterPage只不过是一种特殊的UserControl。当请求内容页面时,它会加载它的MasterPage控件,它与自己的标记合并并创建一个
单页面。每次都会发生这种情况这就是MasterPages的工作原理......


I''m afraid you''ve made the "classic" newbie misconception about
MasterPages
that they are somehow the ASP.NET equivalent of framesets. They are
nothing
at all like framesets. In fact, a MasterPage is nothing more than a
special
kind of UserControl. When a content page is requested, it loads its
MasterPage control which it merges with its own markup and creates a
single
page. This happens every time. That''s how MasterPages work...



有没有好的写一个使用母版页的网站的方式并没有
每次重新加载菜单?


Is there a "Good" way to write a site that uses a master page and doesn''t
make the menu reload every time ?



我显然没有足够清楚地解释 - 当我说那就是如何使用
MasterPages工作时,那个'这就是我的意思...


具体来说,MasterPage只是一个UserControl,就像任何其他UserControl一样。

当你向页面添加UserControl时,每次页面

加载时它都会被加载。这就是UserControls的工作方式。 MasterPage是一个UserControl,因此每次加载页面时都会加载
。这就是MasterPages的工作方式,因为

MasterPages是UserControls ......


MasterPages不是框架。这不是MasterPages的工作原理......

-

Mark Rae

ASP.NET MVP
http://www.markrae.net

I''ve obviously not explained clearly enough - when I said "That''s how
MasterPages work", that''s what I meant...

Specifically, a MasterPage is just a UserControl like any other UserControl.
When you add a UserControl to a page, it gets loaded every time the page
loads. That''s how UserControls work. A MasterPage is a UserControl, so it
gets loaded every time the page loads. That''s how MasterPages work, because
MasterPages are UserControls...

MasterPages are''t frames. That''s not how MasterPages work...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


这篇关于2关于在主页面上使用AJAX的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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