zoukankan      html  css  js  c++  java
  • Sharepoint 提供JavaScript的Web Part

    看代码:

    using System;
    using System.Runtime.InteropServices;
    using System.Web.UI;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Serialization;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.WebPartPages;
    namespace LoisAndClark.Ajax
    {
    [Guid(“be6ec8e3-2706-4f52-bdf9-f6eb18fc65c0”)]
    public class AjaxClient : System.Web.UI.WebControls.WebParts.WebPart
    {
    public AjaxClient()
    {
    PreRender += new EventHandler(AjaxClient_PreRender);
    }
    void AjaxClient_PreRender(object sender, EventArgs e)
    {
    if (!Page.ClientScript.IsClientScriptIncludeRegistered (“MyKey1”))
    {
    Page.ClientScript.RegisterClientScriptInclude(“MyKey1”, “/wpresources/customlib.js”);
    }
    if (!Page.ClientScript.IsClientScriptBlockRegistered(“MyKey2”))
    {
    Page.ClientScript.RegisterClientScriptBlock(typeof(string), “MyKey2”, “alert(‘test’);”, true);
    }
    }
    protected override void CreateChildControls()
    {
    try
    {
    // ... do stuff...
    }
    catch (Exception err)
    {
    Controls.Add(new LiteralControl(err.Message));
    }
    }
    }
    }
    
  • 相关阅读:
    C++ 共用体
    C++ 作用域内枚举
    C++ 作用域为类的常量
    C++ 类作用域
    C++ 对象数组
    C++ this指针
    C++ const成员函数
    C++ 对象的初始化和赋值
    C++ 析构函数
    乌班图 之 apt命令 及 VMware共享文件夹
  • 原文地址:https://www.cnblogs.com/springyangwc/p/1981408.html
Copyright © 2011-2022 走看看