看了一下,知道怎么写了.前台代码就是个默认的页面就行,引用extjs,如下- <head runat="server">
- <title></title>
- <link rel="Stylesheet" type="text/css" href="extjs/res/css/gray.css"/>
- <script type="text/javascript" src="extjs/ext.js"></script>
- <script type="text/javascript" src="extjs/lang/zh_CN.js"></script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <asp:ScriptManager ID="ScriptManager1" runat="server">
- </asp:ScriptManager>
- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
- <ContentTemplate>
- <asp:Button ID="Button1" runat="server" Text="Button" />
- </ContentTemplate>
- </asp:UpdatePanel>
- </div>
- </form>
- </body>
- </html>
复制代码 后台代码很简单,只接引用就行了,只是不知怎么省了第一个参数- Partial Class T
- Inherits System.Web.UI.Page
- Dim info As String
- Dim hr As New OA
- Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
- hr.Show(UpdatePanel1, "网络安监中心", "你在乱上网,不想过了吗,马上去瓜你!")
- End Sub
- End Class
复制代码 最后是最重要的,写在oa.vb中的部分- Public Function Alert(ByVal Title As String, ByVal Msg As String) As String
- Dim StrScript As String
- StrScript = "Ext.MessageBox.alert('" & Title & "','" & Msg & "');"
- Return StrScript
- End Function
复制代码- Public Sub Show(ByVal WebKJ As System.Web.UI.Control, ByVal Title As String, ByVal Msg As String)
- ScriptManager.RegisterStartupScript(WebKJ, Me.GetType(), "", Alert(Title, Msg), True)
- End Sub
复制代码 做好这些后,然后在各个微软的ajax页面中就能使用了.只接show加参数就ok了
|