标签: scriptmanager

如何在使用压缩动态内容时禁用分块传输编码?

我想在我的Web服务器上禁用分块传输编码,以避免此错误:http: //support.microsoft.com/kb/871205.不幸的是,我需要在Win2k上支持IE6,因此他们无法安装补丁.

我找到了将AspEnableChunkedEncoding设置为FALSE的说明,但这似乎并没有解决我的问题.我相信这是因为我们还使用gzip压缩,根据这篇文章(http://www.eggheadcafe.com/conversation.aspx?messageid=31045986&threadid=31045970),压缩编码需要压缩动态内容.因此,所有动态压缩的内容都被"分块"传输,因为它是由gzip过滤器压缩的,而不是ASP.NET.

我知道IIS可以无内容地提供这些内容,因为我尝试在请求中使用http 1.0(它不支持transfer-encoding:chunked),并且响应正确到达并压缩.

如何在使用ScriptManager时禁用分块编码,这需要动态压缩生成的".axd"文件?

iis gzip scriptmanager transfer-encoding internet-explorer-6

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

是否可以使用ASP.NET ScriptManager来使用Windows FIPS安全策略?

如果在Windows中启用"使用FIPS兼容算法进行加密,散列和签名"安全策略选项,则尝试在.NET Framework中使用许多加密类将导致InvalidOperationException.默认情况下,ASP.NET使用AES加密ViewState blob,因此失败.您可以通过向web.config添加这样的键来解决此问题:

<machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="3DES" decryption="3DES"/>
Run Code Online (Sandbox Code Playgroud)

这涵盖了ASP.NET的基本用法.我的问题是:我有一个庞大,复杂的ASP.NET Web应用程序,它大量使用ScriptManagers(ASP.NET AJAX的基础),需要由必须启用此FIPS策略设置的政府客户部署.任何带有ScriptManager的ASP.NET页面都会抛出此异常:

[InvalidOperationException: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.]
   System.Security.Cryptography.SHA1Managed..ctor() +3607454
   System.Security.Policy.Hash.get_SHA1() +45
   System.Web.Handlers.ScriptResourceHandler.GetAssemblyInfoInternal(Assembly assembly) +85
   System.Web.Handlers.ScriptResourceHandler.GetAssemblyInfo(Assembly assembly) +99
   System.Web.Handlers.RuntimeScriptResourceHandler.GetScriptResourceUrlImpl(List`1 assemblyResourceLists, Boolean zip, Boolean notifyScriptLoaded) +525
   System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(List`1 assemblyResourceLists, Boolean zip, Boolean notifyScriptLoaded) +910
   System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(Assembly assembly, String resourceName, CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) +193
   System.Web.UI.ScriptReference.GetUrlFromName(ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip) +306
   System.Web.UI.ScriptManager.RegisterUniqueScripts(List`1 uniqueScripts) +169
   System.Web.UI.ScriptManager.RegisterScripts() +407
   System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +200
   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +11041982 …
Run Code Online (Sandbox Code Playgroud)

.net asp.net scriptmanager fips

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

在剃刀中使用ScriptManager?

必须是一个简单的问题,但我不能为我的生活弄清楚如何在我的视图中包含脚本管理器.<asp:ScriptManager />不起作用.谁知道?

asp.net-mvc scriptmanager razor asp.net-mvc-3

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

没有Microsoft Ajax JavaScript的CompositeScript

我目前正在使用System.Web.Extensions的CompositeScript功能,以便合并我的JavaScript文件以减少下载时间.但是,通过包含任何脚本管理器,我的页面中包含MicrosoftAjax JavaScript代码.我不希望这发生,因为它添加了许多不需要的代码,并且它使事件处理变得复杂.

我正在寻找以下之一:

  1. 结合JavaScript文件的Microsoft脚本管理器的替代方法不包括MicrosoftAjax,并且仍允许用户控件将脚本添加到复合脚本.
  2. 一种说服微软的脚本管理器不发出任何我没有指定的JavaScript的方法.

asp.net asp.net-ajax scriptmanager microsoft-ajax

4
推荐指数
1
解决办法
1358
查看次数

在某些页面上禁用ScriptManager

我的母版页面上有一个脚本管理器.我需要一个或两个内容页面来删除webresourse.axd,因为它会导致页面上的其他JavaScript出现问题

如何在这些页面上禁用脚本管理器?

ScriptManager对象似乎没有任何看起来像他们会完成工作的属性

这可能吗?

asp.net asp.net-ajax scriptmanager

4
推荐指数
1
解决办法
8066
查看次数

How do I detect if a scriptmanager is on the page?

How do I detect if a scriptmanager is loaded on a page? Some aspx pages have it and others don't and I need a user control to understand this so that it can either load it if needed and also for dealing with viewstate.

asp.net scriptmanager

4
推荐指数
1
解决办法
1151
查看次数

UpdatePanel更新没有触发按钮

我有一个指定了ContentTemplate的UpdatePanel.页面加载时,用户可以在页面的其他部分进行一些AJAX工作.然后,在完成该工作之后,我想仅更新UpdatePanel内的内容,但不按任何按钮等.我应该在以前启动AJAX工作完成时使用JavaScript自动完成.如何在不手动点击触发按钮的情况下进行操作?

编辑:

好的,我已经遵循了_doPostBack规则,整个页面都已发布.

    <asp:UpdatePanel ID="panelAttachments" runat="server">
        <ContentTemplate>
    ........
        </ContentTemplate>
    </asp:UpdatePanel>
    <input type="text" name="test" onchange="__doPostBack('<%=panelAttachments.UniqueID %>',''); return false;" />
</td>
Run Code Online (Sandbox Code Playgroud)

谢谢,Pawel

asp.net ajax updatepanel scriptmanager

4
推荐指数
1
解决办法
3945
查看次数

使用C#在用户控件中注册javascript

我想使用C#从User Control调用javascript函数.为此,我试图使用

ScriptManager.RegisterStartupScript(this, typeof(string), "alertbox", "javascript:ShowPopup('Select a row to rate');", true); 
Run Code Online (Sandbox Code Playgroud)

但它不适合我.这在页面上工作正常.有人可以帮助我如何使用C#在运行时调用javascript函数.

谢谢,

javascript c# asp.net user-controls scriptmanager

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

'Sys.WebForms.PageRequestManager'为null或不是对象

嗨,我有一个aspx页面,其中我有以下代码

  <asp:ScriptManager ID="scriptManager" runat="server" AsyncPostBackTimeout="500" EnablePageMethods="true">
            </asp:ScriptManager>

            <script type="text/javascript">
          Sys.Application.add_init(BeginRequestHandler);
          Sys.Application.add_init(EndRequestHandler);

          Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
          Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
          function BeginRequestHandler(sender, args) {
              AsynProcessing('block', 'AlertDiv', 'ProcessingImage');
          }
          function EndRequestHandler(sender, args) {
              AsynProcessing('none', 'AlertDiv', '');
          }
          function AsynProcessing(visstring, elem, img) {
              var adiv = $get(elem);
              adiv.style.display = visstring;
              adiv.image = img;
          }
Run Code Online (Sandbox Code Playgroud)

但是该页面抛出了一个javascrip错误,因为'Sys.WebForms.PageRequestManager'为null或不是对象.我在scriptmanager标签下面放了.我甚至还说道

<xhtmlConformance  mode="Transitional"/>
Run Code Online (Sandbox Code Playgroud)

在web.config.But部分仍然得到相同的错误.
任何帮助深表感谢.提前致谢

asp.net scriptmanager

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

ScriptManager.RegisterStartupScript() 方法不起作用 - ASP.NET、C#

我使用了ScriptManager.RegisterStartupScript()方法,以便在后端发生特定事件时显示警报。它在页面加载方法中工作正常,但在单击特定按钮时调用的特定方法中不起作用。我找不到解决方案,因为在另一个页面中,它在页面加载和方法中都工作正常。

脚本管理器RegisterStartupScript方法

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alert", "alert('msg');", true);
Run Code Online (Sandbox Code Playgroud)

超文本标记语言

<asp:HiddenField runat="server" ClientIDMode="Static" ID="PostBackController"/>
<button class="some-class" id="btnSave" runat="server" onclick="btnSave_clientClick();">SAVE</button>
Run Code Online (Sandbox Code Playgroud)

JavaScript

function btnSave_clientClick() {

     // code

     if (some_condition) {

        $('#PostBackController').val("btn_save");
        __doPostBack();

     }
}
Run Code Online (Sandbox Code Playgroud)

页面加载方法

protected void Page_Load(object sender, EventArgs e)
{
    if (PostBackController.Value == "btn_save")
    {
        uploadDocSave_ServerClick();
    }
}
Run Code Online (Sandbox Code Playgroud)

单击按钮时应调用 Wish 方法

protected void uploadDocSave_ServerClick()
{
    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alert", "alert('msg');", true);
}
Run Code Online (Sandbox Code Playgroud)

javascript c# asp.net jquery scriptmanager

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