dnn一些公用方法分析
2007-03-22 16:54
344 查看
1.' returns a boolean value whether the control is an admin control
Public Function IsAdminControl() As Boolean
' This is needed to avoid an exception if there is no Context. This will occur if code is called from the Scheduler
If HttpContext.Current Is Nothing Then
Return False
End If
Return (IsNothing(HttpContext.Current.Request.QueryString("mid")) = False) Or _
(IsNothing(HttpContext.Current.Request.QueryString("ctl")) = False)
End Function
分析:
IsAdminControl() =true ( 本质就在于ctl=null 或者 ModuleId =null)
就加载module主页面。主页面和其他页面的区别就在与controlkey=null。
2.dnn客户端API函数
RegisterClientScriptBlock: [void RegisterClientScriptBlock (string key,string script)]使用该方法,可以在页面的顶端发布指定的脚本块.每个脚本块与一个键相关连,页面中控件的实例也应该使用该键访问相应的脚本块.该脚本必须在控件之前给出.该脚本块可以包含嵌入式代码与外部脚本程序.
IsClientScriptBlockRegister: [bool IsClientScriptBlockRegister(string key)]检查指定的脚本块是否注册.
RegisterStartupScript: [void RegisterStartupScript(string key,string script)]与RegisterClientScriptBlock的语义相同,但不是大页面顶部给出脚本,而是在底部给出脚本.那么控件产生的脚本还可以引用页面中提供的标签.
IsStartupScriptRegister: [bool IsStartupScriptRegister(string key)]和IsClientScriptBlockRegister的语义相同.
RegisterArrayDeclaraoon: [void RegisterArrayDeclaraoon(string arrayName,string arrayValue)] 使用该方法,控件可以在指定的数组中发布值.页面在客户端脚本中用在arrayName中给出的名字创建一个数组变量,它包含了在同一arrayValue注册过的所有值,这样控件的所有实例都可以往这个数组或值的列表中添加值,以后控件产生的客户端脚本就可以很容易地处理.
RegisterHiddenField: [void RegisterHiddenField(string hiddenFieldName,string initialValue)]具使用该方法,控件可以提供一个隐藏域,当页面提交的时候,通过客户端脚本可以访问该域并将它的值提交给服务器.
RegisterOnSubmitStatement: [void RegisterOnSubmitStatement(string key,string script)] 页面被提交的时,该方法用来注册需要执行的指定的脚本语句.这样控件在客户端的行为可以参与提交过程.
Public Shared Function BrowserSupportsFunctionality(ByVal eFunctionality As DotNetNuke.UI.Utilities.ClientAPI.ClientFunctionality) As Boolean该方法用来检查浏览器是否支持某种格式如(DHTML)eg.ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.DHTML)
Public Shared Sub RegisterClientReference(ByVal objPage As System.Web.UI.Page, ByVal eRef As DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences)该方法用来注册命名空间eg.ClientAPI.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn_mydnn)
Public Function IsAdminControl() As Boolean
' This is needed to avoid an exception if there is no Context. This will occur if code is called from the Scheduler
If HttpContext.Current Is Nothing Then
Return False
End If
Return (IsNothing(HttpContext.Current.Request.QueryString("mid")) = False) Or _
(IsNothing(HttpContext.Current.Request.QueryString("ctl")) = False)
End Function
分析:
IsAdminControl() =true ( 本质就在于ctl=null 或者 ModuleId =null)
就加载module主页面。主页面和其他页面的区别就在与controlkey=null。
2.dnn客户端API函数
RegisterClientScriptBlock: [void RegisterClientScriptBlock (string key,string script)]使用该方法,可以在页面的顶端发布指定的脚本块.每个脚本块与一个键相关连,页面中控件的实例也应该使用该键访问相应的脚本块.该脚本必须在控件之前给出.该脚本块可以包含嵌入式代码与外部脚本程序.
IsClientScriptBlockRegister: [bool IsClientScriptBlockRegister(string key)]检查指定的脚本块是否注册.
RegisterStartupScript: [void RegisterStartupScript(string key,string script)]与RegisterClientScriptBlock的语义相同,但不是大页面顶部给出脚本,而是在底部给出脚本.那么控件产生的脚本还可以引用页面中提供的标签.
IsStartupScriptRegister: [bool IsStartupScriptRegister(string key)]和IsClientScriptBlockRegister的语义相同.
RegisterArrayDeclaraoon: [void RegisterArrayDeclaraoon(string arrayName,string arrayValue)] 使用该方法,控件可以在指定的数组中发布值.页面在客户端脚本中用在arrayName中给出的名字创建一个数组变量,它包含了在同一arrayValue注册过的所有值,这样控件的所有实例都可以往这个数组或值的列表中添加值,以后控件产生的客户端脚本就可以很容易地处理.
RegisterHiddenField: [void RegisterHiddenField(string hiddenFieldName,string initialValue)]具使用该方法,控件可以提供一个隐藏域,当页面提交的时候,通过客户端脚本可以访问该域并将它的值提交给服务器.
RegisterOnSubmitStatement: [void RegisterOnSubmitStatement(string key,string script)] 页面被提交的时,该方法用来注册需要执行的指定的脚本语句.这样控件在客户端的行为可以参与提交过程.
Public Shared Function BrowserSupportsFunctionality(ByVal eFunctionality As DotNetNuke.UI.Utilities.ClientAPI.ClientFunctionality) As Boolean该方法用来检查浏览器是否支持某种格式如(DHTML)eg.ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.DHTML)
Public Shared Sub RegisterClientReference(ByVal objPage As System.Web.UI.Page, ByVal eRef As DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences)该方法用来注册命名空间eg.ClientAPI.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn_mydnn)
相关文章推荐
- 语义分析的一些方法(三)
- 昨天客户拿过来7G的oracle数据让分析,体会到了一些编写软件的方法....
- 一些简单的分析RTSP、RTP/RTCP的方法和工具
- Java Object类讲解 上帝类及其一些方法的分析
- ajax对一些没有接口的数据进行分析和添加方法
- 语义分析的一些方法(下篇)
- 语义分析的一些方法(上篇)
- ngx_lua 一些性能分析方法
- 数组的一些常用方法分析 介绍
- 语义分析的一些方法(三)
- 统计分析之集中、离中、偏态和峰态的一些度量方法
- 关于Java虚拟机性能调优方法的一些分析
- 分析社交网络的一些方法和工具
- 防止网站内容被拷贝的一些方法与优缺点好处与坏处分析
- 分析 源码 的一些方法
- 一個抄來的關于如何讀取網絡上一些網頁內容以及相應處理的方法 , 近日在分析這方面的技術點, 以下這一小部分, 作為一個sample代碼先留下
- Object的一些公用方法
- 通讯录结构体方法的实现 和VS中存在的一些问题的分析
- linux分析日志的一些常用方法
- 线程中一些常用方法的分析