panel problem

Results 1 to 2 of 2

Thread: panel problem

  1. #1
    Join Date
    Dec 1969

    Default panel problem

    I have two panels on a page. One displays a search form, the other the search results.<BR><BR>My VB code behind page, however, keeps saying that my panels haven&#039;t been declared, even though they&#039;re on my aspx page. I tried adding a couple lines to declare them:<BR> Dim pnlSearchForm As Panel<BR> Dim pnlResults As Panel<BR>but then the program threw an error to the effect that it didn&#039;t know what controls these variables corresponded to.<BR><BR>My form code is like this:<BR>&#060;asp:Panel ID="pnlSearchForm" Visible="True" Runat="server"&#062;<BR>(display code here)<BR>&#060;/asp:Panel&#062;<BR><BR>&#060;asp:Panel ID="pnlResults" Visible="False" Runat="server"&#062;<BR>(repeater code here to display search results)<BR>&#060;/asp:Panel&#062;<BR><BR>Then my code-behind page is like this:<BR>...<BR>Sub btnSearch_Click(ByVal s As Object, ByVal e As EventArgs)<BR> &#039;make search form invisible and results visible<BR> pnlSearchForm.Visible = False<BR> pnlResults.Visible = True<BR>...<BR><BR>Anyone have an idea what I&#039;m doing wrong?<BR><BR>TIA.<BR>

  2. #2

    Default RE: panel problem

    Where are they in the Html?<BR>Are they in annother control (an INamingContainer)?<BR><BR>You could trun on tracing and look at the control tree.<BR>You could also try .FindControl in your onclick event and if you get a reference to your panel, drill up using it&#039;s .Parent

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts