日期:2009-08-19 浏览次数:20359 次
以前的的发送消息按钮事件改写如下:
'/////////////////////转到发送即时消息页面
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim i, j As Integer
j = 0
Dim tostu_id As String = ""
For i = 0 To mycheck.Items.Count - 1
If mycheck.Items(i).Selected Then
'////////////////////////限制发送条数
j = j + 1
If j < 6 Then
'/////////////////////参数构造
tostu_id = tostu_id & CheckBoxList1.Items(i).Text & "@"
Else
Label2.Visible = True
Label2.Text = "一次最多能给五个用户发送信息!"
Return
'Response.Write("<script language=JavaScript>window.open('info.aspx?tostu_id=' & CheckBoxList1.Items(i).Text,'','height=330,width=560,status=no,location=no,toolbar=no,directories=no,menubar=no')</script>")
End If
End If
Next i
Response.Redirect("info.aspx?tostu_id=" & tostu_id)
End Sub
这里发送信息的页面由于修改的比较多,所以把全部代码全都抓来了,呵呵:)
codebebind部分:
Imports System.Data
Imports System.Data.SqlClient
Public Class info
Inherits System.Web.UI.Page
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Button2 As System.Web.UI.WebControls.Button
Protected WithEvents Label3 As System.Web.UI.WebControls.Label
Protected WithEvents Label4 As System.Web.UI.WebControls.Label
Protected WithEvents Label5 As System.Web.UI.WebControls.Label
Protected WithEvents Label6 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox3 As System.Web.UI.WebControls.TextBox
Protected WithEvents Image3 As System.Web.UI.WebControls.Image
Protected WithEvents Label8 As System.Web.UI.WebControls.Label
Protected WithEvents Label7 As System.Web.UI.WebControls.Label
Protected WithEvents Label9 As System.Web.UI.WebControls.Label
Protected WithEvents Label10 As System.Web.UI.WebControls.Label
Protected WithEvents Button3 As System.Web.UI.WebControls.Button
Protected WithEvents Label11 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Dim conn As SqlConnection = New SqlConnection("server=lixinri;uid=sa;pwd=;database=99re1")
Public Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim tostu_id As String = Request.QueryString("tostu_id")