母版页中的Ajax无法正常工作 [英] Ajax in masterpage not working

查看:55
本文介绍了母版页中的Ajax无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
我很困惑我的代码有什么问题.
在创建具有母版页的aspx页之后,然后在其中添加一个AJAX(例如:CalendarExtender),使其正常工作.
但是,经过一段时间的其他编码(例如向其他控件(文本框,按钮,标签容器)添加样式)后,日历扩展器和模式弹出窗口没有出现.

我已经将引用(ajaxcontroltoolkit.dll)添加到我的引用文件夹中. 这是我的示例代码之一:


p/s:但是我的tabcontainer正在工作.

带有日历扩展程序(DIDNT WORK)和标签容器(WORKING)的页面:

Hye all..
Im quite confuse of what is wrong with my code.
After creating an aspx page with master page, then I add an AJAX inside (for example: CalendarExtender), its working.
However, after a while doing other coding like adding styles to other control (textbox, button, tab container), the calendar extender and modal popup didnt appear.

I have already add references (ajaxcontroltoolkit.dll) to my reference folder.
This is one of my sample code:


p/s: However my tabcontainer is WORKING.

Page with calendar extender(DIDNT WORK) and tab container (WORKING):

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site1.Master" CodeBehind="WebForm1.aspx.vb" Inherits="QFMSWeb.WebForm1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link href="../CSS/Tab.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/calendarExt.css" rel="stylesheet" type="text/css" />
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <cc1:CalendarExtender ID="TextBox1_CalendarExtender" runat="server"

        CssClass="MyCalendar" Enabled="True" TargetControlID="TextBox1">
    </cc1:CalendarExtender>
    <br />
    <cc1:TabContainer ID="TabContainer1" runat="server" Font-Strikeout="False"

        CssClass="Tab" ActiveTabIndex="0" Width="250px" Height="94px">
    <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Customer">
    <ContentTemplate>
    <br />
    Customer Details
    </ContentTemplate>
    </cc1:TabPanel>
    </cc1:TabContainer>
</asp:Content>






请提出一些建议,我需要做什么来显示我的日历扩展器.谢谢你们!! :)






Please give some suggestion what need I do to display my calendar extender. thank you all!! :)

推荐答案

你好朋友,

通常,脚本管理器控件将随Ajax页面一起成为默认设置.
因此,无需再次添加ScriptManager控件.

可能是问题所在....请检查一下.
Hello Friend,

Generally Script Manager Control will come Default With Ajax Page.
So No need to add Again ScriptManager Control.

May be this was the problem....Please Check it.


我没有看到任何错误,因为其他错误的"link"标签也没有.从此处删除并将其放置在母版页的标题标签中.

休息一切看起来还可以.页面是否抛出任何错误?还是只是缺少的补充剂?进行我要求的更改后,请执行页面的查看源.看看是否存在扩展器.
I don''t see anything wrong as such other then misplaced ''link'' tags. Remove from here and place them in the head tag of master page.

Rest everything looks ok. Does page throw any error? Or just the missing extender? Do a View-Source of page after making the change I asked. See, if the extender exists or not.


这篇关于母版页中的Ajax无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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