⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 baodao.aspx.vb

📁 AJAX第二版用于网络传输的一个系统 AJAX第二版用于网络传输的一个系统
💻 VB
字号:
Imports System.Data.SqlClient
Imports system.configuration
Imports System.Web.Configuration
Imports System.Data
Imports System.Drawing
Partial Class baodao
    Inherits System.Web.UI.Page
    Public pulic As New pulic1
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        chushihua()
        Dim str As String = "select distinct nsrname,nsrid,skkid from nsrinf where nsrid is not null"
        If TextBox2.Text <> "" Then
            str = str + " and nsrname like '%" + TextBox2.Text().Trim + "%'"
        End If
        If TextBox1.Text <> "" Then
            str = str + " and nsrid like '%" + TextBox1.Text().Trim + "%'"
        End If
        If TextBox3.Text <> "" Then
            str = str + " and skkid like '%" + TextBox3.Text().Trim + "%'"
        End If
        Dim cmd2 As SqlDataReader = pulic.execute(str)
        If cmd2.HasRows Then
            GridView1.DataSource = cmd2
            GridView1.AllowSorting = True
            GridView1.DataBind()
        Else
            ' UpdateProgress1.ProgressTemplate.InstantiateIn(Label1)
            MsgBox("无相关信息!", 0, "提示:")
            ' MsgBox("无相关信息!", 0, "提示:")
            ' Dim mplabel As Label = CType(PreviousPage.FindControl("label9"), Label)
            ' CType(PreviousPage.FindControl("label9"), Label).Text = "无相关信息!"
            'Dim bb, aa As Label
            'Dim con As Content
            'Dim conp As ContentPlaceHolder
            'Dim ajax As UpdateProgress
            ' Dim ajax2 As UpdatePanel
            ' con = Me.FindControl("Content1")
            ' conp = Master.FindControl("ContentPlaceHolder1")
            ' ajax2 = conp.FindControl("UpdatePanel1")
            ' ajax = ajax2.FindControl("UpdateProgress1")
            'aa = DirectCast(ajax2.FindControl("label11"), Label)
            ' aa = ajax2.Page.FindControl("label9")

        End If
        cmd2.Close()
    End Sub


    Protected Sub setFields()
        '建立命令字段
        GridView1.AutoGenerateColumns = False
        Dim selectField As New CommandField()
        selectField.ButtonType = ButtonType.Link
        selectField.ShowSelectButton = True   '显示选择按钮
        selectField.SelectText = "选择"
        selectField.HeaderText = "按钮"
        '  selectField.ItemStyle.Wrap = False

        '建立数据绑定字段
        Dim employeeidField As New BoundField()
        employeeidField.DataField = "nsrname" '指定数据来源字段
        employeeidField.HeaderText = "纳税人名称" '设置字段头名称
        'employeeidField.SortExpression = "nsrid" '指定排序字段名称
        employeeidField.ItemStyle.Wrap = True
        'employeeidField.ItemStyle.HorizontalAlign = HorizontalAlign.Center
        '将字段加入到GridView

        GridView1.Columns.Add(selectField)
        GridView1.Columns.Add(employeeidField)
        GridView1.DataBind()
    End Sub
   
  
    Protected Sub chushihua()
        GridView1.SelectedRowStyle.Reset()
        Session("grid2") = ""
        Session("grid3") = ""
        GridView1.DataSourceID = ""
        GridView2.DataSourceID = ""
        GridView2.AllowSorting = False
        GridView2.Visible = False
        GridView3.DataSourceID = ""
        GridView3.AllowSorting = False
        GridView3.Visible = False
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
    End Sub
  

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Not IsPostBack) Then
            setFields()

        End If
        ' pulic.xianshi(GridView1)
        If Session("grid2") <> "" Or Session("grid3") <> "" Then
            pulic.selectcommand(GridView2, sql2, Session("grid2"))
            pulic.selectcommand(GridView3, sql3, Session("grid3"))
        Else
            GridView2.DataSourceID = ""
            GridView3.DataSourceID = ""
        End If
    End Sub

End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -