网页起始处理

<script language="vb" runat="server">
    Sub page_load(ByVal sender As Object, ByVal e As EventArgs)
        Dim Conn As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
        Conn.Open()
        Dim Da As SqlDataAdapter
        Dim Rs As DataSet
        Dim Dt As DataTable
        Da = New SqlDataAdapter("select * from blog_reg order by blog_id asc", Conn)
        Rs = New DataSet()
        Da.Fill(Rs, "list1")
        Dt = Rs.Tables("list1")
      
        list00.DataSource = Rs.Tables("list1").DefaultView
        list00.DataBind()
       
      
        '指定下拉菜单显示字段
        DropDownList1.DataValueField = "blog_user"
        '绑定数据源至下拉菜单
        DropDownList1.DataSource = Rs.Tables("list1")
        DropDownList1.DataBind()
       
        pageall.Text = "共有<font color=red>" & Dt.Rows.Count & "</font>个用户, 分为<font color=red>" & list00.PageCount & "</f页显示"
        Rs = Nothing
       
    End Sub
   
    Sub this_change(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs)
        'pageall.text &= ", 现在是第&nbsp;&nbsp;<strong>" & CInt(e.newpageindex) + 1 & "</strong>&nbsp;&nbsp;页!"
        list00.CurrentPageIndex = e.NewPageIndex
        list00.DataBind()
    End Sub

    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim Conn As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
        Conn.Open()
        Dim Da As SqlDataAdapter
        Dim Rs2 As DataSet
        Dim Dt As DataTable
        Da = New SqlDataAdapter("select * from blog_reg where blog_user='" & DropDownList1.SelectedValue & "'", Conn)
        Rs2 = New DataSet()
        Da.Fill(Rs2, "list2")
        Dt = Rs2.Tables("list2")
        GridView1.DataSource = Rs2.Tables("list2").DefaultView
        GridView1.DataBind()
        blog_user.Text = Dt.Rows(0).Item("blog_user").ToString
        blog_nc.Text = Dt.Rows(0).Item("blog_nc").ToString
        blog_pwd.Text = Dt.Rows(0).Item("blog_pass").ToString
        blog_name.Text = Dt.Rows(0).Item("blog_name").ToString
        blog_city.Text = Dt.Rows(0).Item("city1").ToString
        regtime.Text = Dt.Rows(0).Item("reg_time").ToString
        Rs2 = Nothing
    End Sub

</script> 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值