Microsoft
Software
Hardware
Network
Question : Hide submit button if datalist control is empty
I would like to hide a submit button if a DataList is empty. I don't really know the code. If you submit an answer please show me the code also. I have to do it in VB.Net. I googled and found the following code that I place in the code behind under the Page load event.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim dv As DataList
dv = SqlDataSource3.[Select](Da
taSourceSe
lectArgume
nts.Empty)
'Change DataSource name
If dv.ToTable.Rows.Count = 0 Then
Button1.Visible = False
End If
What I am having a problem with is the To.Table. I get the following error. 'ToTable' is not a member of 'System.Web.UI.WebControls
.DataList'
. I tried to get smart and attempted to stick the button within the datalist itself but quickly found out that does not work. PLEASE HELP!
Answer : Hide submit button if datalist control is empty
to get the value then just use
string abbreviation = DropDownList1.SelectedValu
e;
Random Solutions
Adding Roles to Roles In Custom Membership Provider - A Better Way ? C#, SQL, Oracle, ASP.NET
Build and run of Actuate reports
imap_mail_move on POP3 mailbox
Do you know a utility in Unix I could use that would compare 2 files (for ex:, files A.txt vs B.txt) and display the differences between the 2 files?
Non-Dell motherboard upgrade for Dell XPS Generation 5 Case
Delete temporary internet files?
problem killing a session in java
SAS 9.1 - Excel Import
Intel Core 2 Quad CPU Overheating Issues
DCOM was unable to communicate with the computer "Name" using any of the configured protocols.