1。看一下该控件的名称是不是txtKind
2。如果是看一下定义处是否是txtKind,如果没有手动添加
protected System.Web.UI.WebControls.TextBox txtKind;
(c#)
2。如果是看一下定义处是否是txtKind,如果没有手动添加
protected System.Web.UI.WebControls.TextBox txtKind;
(c#)
解决方案 »
- dropdownlist编辑时选中项
- 一个DataGrid显示的很难的问题,还没人能解决!
- 读textBox值乱码问题,找了三天三夜的资料,都没解决,请高手们帮帮忙?在线等!
- freetextbox问题,为什么输入的内容太多的话,就不出错!
- asp.net 中如何做到对一个页面的插入向asp中include一样
- 请问 如何用客户端事件获得服务端的webGrid或datagrid的一行id 然后id传回服务端 要不刷新!
- 文件下载?
- 100分求:求大于指定数据的最小的,只有一个非零位的数
- 找不到自己写的类?
- Somebody help me!
- 能不能在web页中打印Datagrid???
- 为什么我用DataGrid分页显示时是一片空白?换页事件也写了呀.
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %><html>
<script language="VB" runat="server"> Dim MyConnection As SqlConnection Sub Page_Load(Sender As Object, E As EventArgs) MyConnection = New SqlConnection("server=(local)\NetSDK;database=pubs;Trusted_Connection=yes")
If Not (IsPostBack) Dim DS As DataSet
Dim MyCommand As SqlDataAdapter MyCommand = New SqlDataAdapter("select distinct State from Authors", MyConnection)
DS = new DataSet()
MyCommand.Fill(DS, "States") MySelect.DataSource= DS.Tables("States").DefaultView
MySelect.DataBind()
End If
End Sub Sub GetAuthors_Click(Sender As Object, E As EventArgs) Dim SelectCmd As String = "select * from Authors where state = @State" Dim DS As DataSet
Dim MyCommand As SqlDataAdapter MyCommand = New SqlDataAdapter(SelectCmd, MyConnection) MyCommand.SelectCommand.Parameters.Add(New SqlParameter("@State", SqlDbType.NVarChar, 2))
MyCommand.SelectCommand.Parameters("@State").Value = MySelect.Value DS = new DataSet()
MyCommand.Fill(DS, "Authors") MyDataGrid.DataSource= DS.Tables("Authors").DefaultView
MyDataGrid.DataBind()
End Sub</script>