如何强制我的 SharePoint AjaxSmartPart 使用较小的“发布”部分 模式 JavaScript?

发布于 2024-07-10 12:00:20 字数 463 浏览 4 评论 0原文

我在 WSS3 上使用 ReturnOfSmartPartSharepoint 中的 ASCX 显示为 Web 部件。 这效果很好。

唯一的问题是 AjaxSmartPart 似乎正在使用调试模式 javascript(脚本接近 1MB!)

我如何确保 AjaxSmartPart 仅使用 发布模式java脚本?

注意:

  • 我已经在Release中发布了我的ASCX 模式。
  • 我的 Sharepoint web.config 中的 Debug="false"

I use ReturnOfSmartPart on WSS3 to display a ASCX in Sharepoint as a web part. This works beautifully.

The only problem is that the AjaxSmartPart seems to be using the Debug mode javascript (the scripts are close to 1MB!)

How can I ensure that the AjaxSmartPart only uses the Release mode java scripts?

Note:

  • I have Published my ASCX in Release
    mode.
  • Debug="false" in my Sharepoint web.config

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

很糊涂小朋友 2024-07-17 12:00:20

很简单,将 web.config 调试模式设置为 false。 这应该已经可以工作了。

如果您希望覆盖该行为,请将以下代码放入 ASCX 的 OnPreRender 方法中...

protected override void OnInit(EventArgs e)
{
    ScriptManager sm = ScriptManager.GetCurrent(this.Page);
    sm.ScriptMode = ScriptMode.Release;

    base.OnInit(e);
}

Simple, set your web.config Debug mode to false. This should already work.

If you wish to override the behaviour, put the following code in your OnPreRender method of your ASCX...

protected override void OnInit(EventArgs e)
{
    ScriptManager sm = ScriptManager.GetCurrent(this.Page);
    sm.ScriptMode = ScriptMode.Release;

    base.OnInit(e);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文