How can I get my AjaxSmartPart SharePoint to use less "Release" javascript mode?

I am using ReturnOfSmartPart

in WSS3

to display ASCX

in Sharepoint

as a web part. This works great.

The only problem is that AjaxSmartPart

it seems to be using javascript in debug mode (scripts are close to 1MB!)

How can I ensure that I AjaxSmartPart

only use java mode scripts Release

?

Note:

  • I published mine ASCX

    in the issue of Mode.
  • Debug="false"

    in my Sharepoint

    web.config

+1


source to share


1 answer


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

If you want to override the behavior, 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);
}

      

0


source







All Articles