标签: updatepanel

如何使TinyMCE在UpdatePanel中工作?

我正在尝试做一些许多人似乎能够做到但我无法实现任何解决方案的事情.该TinyMCE的控制工作得很好,在一个asp.net的形式,直到你有一个UpdatePanel,然后回发后坏括起来.我尝试了一些像RegisterClientScriptBlock方法的修复,但仍然不成功,我在回发后仍然失去了tinyMCE控件.

下面是一个完整的测试项目(VS 2008),它在UpdatePanel外部提供一个Control,内部有一个控件,每个项目都有一个按钮来生成回发.同样在项目中我有一个EditorTest控件,其中包含我尝试的一些调用的注释代码,以防它给任何人任何想法.

代码示例

以下是MCE论坛上一些解决方案的一些来源:
AJAX
UpdatePanel

javascript c# asp.net updatepanel tinymce

14
推荐指数
2
解决办法
2万
查看次数

在ASP.NET应用程序中使用Ajax更新面板的优点和缺点

在ASP.NET应用程序中使用Ajax更新面板有哪些优缺点.有没有其他方法可以避免使用Ajax更新面板?

asp.net ajax updatepanel

14
推荐指数
2
解决办法
2万
查看次数

在Update面板AJAX asp.net之后运行脚本

我正在我的网站上运行ajax更新面板.更新面板返回一些新控件.我想在从ajax调用返回控件之后为控件设置一些JavaScript.有没有办法做到这一点?谢谢你的帮助!

javascript c# asp.net ajax updatepanel

14
推荐指数
1
解决办法
8744
查看次数

将多个控件放在更新面板中的正确方法是什么?

我有一个注册表单,其中包含3到4个下拉控件和2个日期选择器,现在当选择下拉控件值时(选择索引更改被触发)然后我不希望我的页面回发.

我使用更新面板来阻止这种帖子的行为,如下所示:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>

      <%--Update Panel for date picker%>
      <asp:UpdatePanel ID="UpdatePanelDatepicker" runat="server">
                    <ContentTemplate>
                      <telerik:RadDatePicker ID="rdpDate1" runat="server">
                      </telerik:RadDatePicker>
                    </ContentTemplate>
      </asp:UpdatePanel>

       <%--Update Panel for Dropdown--%>
       <asp:UpdatePanel ID="updatepaneldata" runat="server"> 
                      <ContentTemplate>
                     <telerik:RadComboBox ID="ddlCountry" runat="server">
                      </telerik:RadComboBox>
                    </ContentTemplate>
      </asp:UpdatePanel>


  </ContentTemplate>
    </asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)

所以我只是想问这是在更新面板下放置多个控件的正确方法吗?

c# asp.net updatepanel telerik

14
推荐指数
1
解决办法
1357
查看次数

更新UpdatePanel外部的控件

所以我有UserControl一些级联DropDownList的东西.从列表1中选择启用列表2,列表2依次启用列表3.在所有三个列表中进行选择后,您可以转到下一页.

DropDownLists为所有内部的UpdatePanel.但是"下一页"按钮在...之外UpdatePanel.应该禁用该按钮,直到所有三个列表都有选择,然后再次启用它.但由于按钮位于按钮之外UpdatePanel,因此在进行选择时不会更新.(编辑:"下一页"按钮位于同时包含该页面的页面上UserControl.)

我知道解决这个问题的一种方法:

var scriptManager = ScriptManager.GetCurrent(this.Page);
scriptManager.RegisterPostBackControl(dropDownList1);
scriptManager.RegisterPostBackControl(dropDownList2);
scriptManager.RegisterPostBackControl(dropDownList3);
Run Code Online (Sandbox Code Playgroud)

这可以确保在更改任何下拉列表时进行回发,以便按钮可以更新.但是,如果我这样做,我可以通过UpdatePanel首先摆脱它来简化.

还有另外一种方法,通过一些聪明的JavaScript或其他东西,我可以在UpdatePanel不必放弃Ajax 的情况下更新控件吗?

c# asp.net ajax updatepanel asp.net-ajax

13
推荐指数
2
解决办法
3万
查看次数

将控件动态添加到ASP.NET AJAX中的UpdatePanel

我有以下非常简单的代码

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
    <asp:PlaceHolder ID="PlaceHolder1" runat="server">
    </asp:PlaceHolder>
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)

而代码隐藏

protected void Button1_Click(object sender, EventArgs e)
{
    Literal literal = new Literal();
    literal.Text = DateTime.Now.ToString();
    literal.ID = DateTime.Now.Ticks.ToString();

    // These both work fine the first time the button is clicked
    // but the second time nothing is added.
    UpdatePanel1.ContentTemplateContainer.Controls.Add(literal);
    PlaceHolder1.Controls.Add(literal);
}
Run Code Online (Sandbox Code Playgroud)

我的问题在于Literal控件只添加一次.我已经搜索了谷歌和博客网站(加上书籍),但没有任何运气.我错过了什么?

asp.net ajax updatepanel

13
推荐指数
1
解决办法
5万
查看次数

确定哪个UpdatePanel导致部分(异步)PostBack?

在一个页面中包含两个UpdatePanels,我怎么知道哪个UpdatePanel部分原因PostBack

我的意思是在Page_Load事件处理程序中.

这是我的代码:

 <asp:ScriptManager ID="ScriptManager1" runat="server">
 </asp:ScriptManager>
 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" 
     onprerender="UpdatePanel1_PreRender">
     <ContentTemplate>
         <A:u1 ID="u1" runat="server" />
     </ContentTemplate>
 </asp:UpdatePanel>
 <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" 
     onprerender="UpdatePanel2_PreRender">
     <ContentTemplate>
         <A:u2 ID="u2" runat="server" />
     </ContentTemplate>
 </asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)

我尝试了这段代码,但它并没有用到!

protected void Page_Load(object sender, EventArgs e)
{
    if (ScriptManager.GetCurrent(Page).IsInAsyncPostBack)
    {
        if (UpdatePanel1.IsInPartialRendering)
        {
            // never enter to here
        }
        if (UpdatePanel2.IsInPartialRendering)
        {
            // neither here
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

任何帮助!

asp.net postback updatepanel

13
推荐指数
3
解决办法
1万
查看次数

Response.Write和UpdatePanel

我使用以下代码片段生成一个我发送给客户端的vcard:

Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}", fileNameOnly));
Response.ContentType = "text/x-vcard";
Response.ContentEncoding = Encoding.GetEncoding("ISO-8859-1");
Response.Write(vCard.ToString());
Response.End();
Run Code Online (Sandbox Code Playgroud)

但是,我需要在内部具有控件和UpdatePanel的页面上使用vCards.不幸的是,根据更新面板和响应写入, 这不起作用并导致错误.我想知道什么是将vcard /文件的内容发送到客户端浏览器的其他方法,并让它显示"打开/保存"对话框,不涉及Response.Write?

asp.net updatepanel response.write httpresponse

13
推荐指数
1
解决办法
2万
查看次数

在asp.net UpdatePanel里面的jquery ui datepicker

我有一个网页,我在asp.net文本框上使用jQuery UI datepicker,它位于UpdatePanel内.这是我粗略做的描述

<script type="text/javascript">
    $(document).ready( function() { $(".datepicker").datepicker(); } );
</script>

<asp:UpdatePanel ... >
    ...
    <asp:TextBox runat="server" CssClass="datepicker" />
    <asp:Button runat="server" />
    ...
</asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)

当我第一次加载页面时,一切正常.在文本框内单击时,会弹出日期选择器.但是当我单击按钮并执行异步回发时,再次单击该字段时,不再弹出日期选择器.

我知道问题是因为UpdatePanel在更新时完全替换了所有包含的HTML,因此实际上它是一个新的文本字段,尚未使用datepicker功能进行初始化.

我想我不应该在这里使用$(document).ready()初始化我的日期选择器,但是在哪里放置初始化代码的好地方?或者有一种方法可以在AJAX更新后重新触发初始化代码?

asp.net jquery updatepanel jquery-ui asp.net-ajax

12
推荐指数
2
解决办法
2万
查看次数

如何在javascript函数中触发updatepanel

我的asp.net网页上有一个updatepanel.我想触发javascript函数内的updatepanel,触发一个按钮.
为了做到这一点,我使用了__doPostBack('myUpdatePanel', '');功能.但我认为这会导致整页回发.我调用此函数时也会执行我的document.ready函数.我可能会错过一些观点.
有什么其他方法可以在javascript函数中触发updatepanel吗?

javascript asp.net updatepanel

12
推荐指数
1
解决办法
2万
查看次数