一、弹出消息框
Function AlertMsg(ByVal Msg_str As String) As String
Return "<script language=javascript>alert('" & Msg_str & "')</script>"
End Function
Page.ClientScript.RegisterStartupScript(Me.GetType, "Alert", AlertMsg("消息通知"))
----------
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RedirectLoginPage", "<script language=javascript>window.parent.Bar.location='bar.aspx';</script>");
----------
Between UpdatePanel
System.Web.UI.ScriptManager.RegisterStartupScript(Me.Page, Me.GetType, "alt", "alert('" & lab_msg.Text & "')", True)
二、简单的确认对话框
btnSubmit.Attributes.Add("onclick", "return confirm('Confirm to submit?');")
三、日历控件
1 Dim txtbox8_onfocus As String = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:true,skin:'whyGreen',readOnly:false,position:{top:'under'},maxDate:'#F{$dp.$D(\'" & TextBox12.ClientID & "\',{d:0});}',minDate:'" & Now.ToString("yyyy-MM-dd HH:mm") & "'})"
2 TextBox8.Attributes.Add("onfocus", txtbox8_onfocus)
3 Dim txtbox12_onfocus As String = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:true,skin:'whyGreen',readOnly:false,position:{top:'under'},minDate:'#F{$dp.$D(\'" & TextBox8.ClientID & "\',{d:0});}'})"
4 TextBox12.Attributes.Add("onfocus", txtbox12_onfocus)
四、showModelessDialog 缓存严重的解决办法
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">