Public Sub DropDownList_changed(ByVal db_list As System.Object, ByVal e As System.EventArgs)
??????????????????
这里我要怎样写呢 End Sub
解决方案 »
- ASP.NET的问题
- 我想开发一个论坛帖子群发的c/s软件,可以获得发帖后的网址
- Log4net写日志的问题,我想把日志按照类别写不同的文件,不局限INFO,ERROR,FATAL固定的这3类。如何扩展实现呢?
- GridView自带的删除以及编辑按钮,点击后没反映
- ~ 请再帮忙看看如何处理 ~~~~~~~~~~
- 是否有这样的.net控件呢?有一文本框和一按钮(文本框中,可以输入内容,也可以从.....)
- 在asp.net里面怎么使用visio来画组织结构图!
- 在哪儿设置Application的存活时间?
- 急急急!vistual studio.net 无法创建或打开应用程序,这个怎么解决?
- 图片裁剪,使用CopyFromScreen方法,提示句柄无效,怎么解决呢,谢谢先!!!
- asp 和asp.net 在性能上的区别有多大?等
- 如何不通过ASP.Net实现的会话状态?
你里面随便你怎么写
例如:if dropdownlist.selectedindex=2 then
end if
if dropdownlist.selectitem.text="hello" then
end if
....
end if
你里面随便你怎么写
例如:if dropdownlist.selectedindex=多少then
end if
'在此处放置初始化页的用户代码
Dim db_list As New DataGrid()
Try
f_sConnection = oCS.GetConnectionString()
f_SipDbConnection = New OleDbConnection(f_sConnection)
If Not IsPostBack Then
ShowTableList("1") End If Catch eLoad As System.Exception
Me.Response.Write(eLoad.Message)
f_SipDbConnection.Close()
End Try End Sub
Private Sub ShowTableList(ByVal query_type As String)
Dim view_name As String If query_type = "1" Then
sSqlString = "SELECT ASC_ID, AAC_NAME AS 广告商 FROM ADA_AAC_INFO_TABLE"
view_name = "ADA_AAC_INFO_TABLE" Else
Exit Sub End If Try
Dim dsDN As New DataSet()
Dim sda_DN As New OleDbDataAdapter(sSqlString, f_SipDbConnection)
dsDN.Clear()
sda_DN.Fill(dsDN, view_name)
If dsDN.Tables(view_name).Rows.Count > 0 Then
DropDownList1.DataSource = dsDN.Tables(view_name).DefaultView
DropDownList1.Visible = True
DropDownList1.DataTextField = "AAC_NAME"
DropDownList1.DataValueField = "ASC_ID"
DropDownList1.SelectedIndex = 0
DropDownList1.DataBind() f_SipDbConnection.Close()
Else
Exit Sub
End If Catch eLoad As System.Exception
Me.Response.Write(eLoad.Message)
f_SipDbConnection.Close() End Try
End Sub Public Sub DropDownList_changed(ByVal db_list As System.Object, ByVal e As System.EventArgs) db_list.CurrentPageIndex = 0
End SubEnd Class帮我看看,这样写调试时没有东西出来?
string TCID=DropDownList1.SelectedValue.ToString().Trim();//取得字段
string Conn= ConfigurationSettings.AppSettings.Get("Con");SqlConnection myconn=new SqlConnection(Conn);
string sql="select xxxx,xxxxxfrom ProductCategory where(TotalCategoryId='"+TCID+"')";
DataTable DT=new DataTable();
SqlDataAdapter SDA=new SqlDataAdapter(sql,myconn);
SDA.Fill(DT);
DropDownList2.DataSource=DT.DefaultView;
DropDownList2.DataTextField="xxxxxx";
DropDownList2.DataValueField="xxxxxx";
DropDownList2.DataBind();
我是用C#写的,由DropDownList1控制DropDownList2,将你数据库的字段赋值给DropDownList2.DataTextField和DropDownList2.DataValueField就ok了
response.write(drop.selecteditem.text) End Sub