SqlDataSource.SelectParameters的格式化参数问题
当在内容页(aspx)里面用一个TextBox里面的值作为SqlDataSource.SelectParameters参数时,怎样才能去掉TextBox里面的首尾空格?
附代码:
<asp:TextBox ID= "tbIsExist " runat= "server "> </asp:TextBox>
<asp:SqlDataSource ID=...>
<SelectParameters>
<asp:ControlParameter ControlID= "tbIsExist " Name= "CName " PropertyName= "Text " Type= "String " />
</SelectParameters>
</asp:SqlDataSource>
------解决方案--------------------我再帮你顶一下
------解决方案-------------------- <asp:TextBox ID= "tbIsExist " runat= "server "> </asp:TextBox> 里加自动去除空格
内容改变时触发事件:tbIsExist.Text=tbIsExist.Text.Trim()