Saturday, March 24, 2012

Panel Visible or Not

Because I'm new to asp.net I either don't know what to do in some cases or I just overlook the obvious.
I want to set Visible=True or False on a panel
This is what I'm trying, but obviously something is out of place.
*********************************************************
Private Sub Page_Load2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack() Then
If Request.QueryString("CategoryID") = ("8") Then
Dim connStr As SqlConnection
Dim sqlStr As String
Dim sqlCmd As SqlCommand
Dim sdReader As SqlDataReader
connStr = New SqlConnection(ConfigurationSettings.AppSettings("sqlCon.ConnectionString"))
sqlStr = ("SELECT * FROM catalogItems WHERE " _
& "ddlFlavLimiter = '" & ("on") & "' or " _
& "categoryID = '" & ("98") & "' ORDER BY itemID")
sqlCmd = New SqlCommand(sqlStr, connStr)
connStr.Open()
sdReader = sqlCmd.ExecuteReader()
ddlItem2.DataSource = sdReader
ddlItem2.DataBind()
connStr.Close()
connStr = Nothing
sdReader.Close()
sdReader = Nothing
If sdReader("Fla2").ToString = ("on") Then
Me.Panel1.Visible = True
Else
Me.Panel1.Visible = False
End If
End If
End If
End Sub

I got it! Thanks if you're already reading. I do have another post though.

0 comments:

Post a Comment