Panels are pretty cool. Consider them the equivalent to DIV or span tags, only they can be controlled with server-side code. We can use the following sample from an .aspx page: <asp:Panel id="pnlPanel1" runat="server"> <table><tr><td>Table 1</td></tr></table> </asp:Panel> <asp:Panel id="pnlPanel2" runat="server"> <table><tr><td>Table 2</td></tr></table> </asp:Panel> Let's say you need to show 1 of 2 tables (or any other HTML) based on a value in a variable within your code-behind page. You can do this: If variable = "1" Then pnlPanel1.Visible = True pnlPanel2.Visible = False Else pnlPanel1.Visible = False pnlPanel2.Visible = True End If By setting the Visible property, you can show or hide the panels in your server-side code. I use Panels on pages that are used to run reports. In my case, pnlPanel1 would hold the table and controls used to pick or supply parameters for my reports. pnlPanel2 would hold a server control (like a repeater) that is bound with the report results. When the user submits the form, I hide pnlPanel1, bind my results to the repeater control and then show pnlPanel2 by using the visible property. Works great! BTW, tell your hair that I said "you're welcome"!
PogoWolf <[EMAIL PROTECTED]> wrote: I would.. I did get it to work the the code block, and an IF..THEN (ye Olde ASP trick) but I'm not sure about the panel thing. On 4/20/05, Mark E <[EMAIL PROTECTED]> wrote: > You don't have to. Use Panels. They will do exactly > what you want. > > Move your if statements to your code behind page, > evaluate the variable and show or hide the appropriate > panel based on the out come. > > Let me know if you need more details. > > Mark > --- PogoWolf <[EMAIL PROTECTED]> wrote: > > > > in addition to the last post.. > > if it was JUST this line, making it a literal > > wouldn't be a problem. The > > issue is the '2nd' IF..THEN has about 75 lines of > > HTML to hide if the > > condition is false.. > > I'm not looking forward to hacking that HTML into > > bunch of > > response.writes. > > > > > > _____ > > > > From: [email protected] > > [mailto:[EMAIL PROTECTED] On > > Behalf Of Adrian Forbes - > > ITD > > Sent: Wednesday, April 20, 2005 6:12 AM > > To: [email protected] > > Subject: RE: [ASP] Code blocks are not supported in > > this context. (ASP.NET ) > > > > > > > Line 51 - 57 > > > <% > > > IF LEN(ColumnCheck) = 0 THEN > > > Response.Write ("<TD style='WIDTH: 50%;'>") > > > ELSE > > > Response.Write("<TD>") > > > END IF > > > %> > > > > Don't think you can inject code like that in asp.net > > the way you could in > > asp. You need to place a server control there and > > on the page load event > > have your code update the content. Something like > > > > <asp:Literal ID="MyTD" runat="server"/> > > > > Then in the Page_onLoad event; > > > > If len(ColumnCheck) = 0 then > > MyTD.Text = "<TD style='WIDTH: 50%;'>" > > Else > > MyTD.Text = "<td>" > > End if > > > > Something like that anyway, unless someone can think > > of something better. > > > > > > The contents of this email and any attachments are > > sent for the personal > > attention > > of the addressee(s) only and may be confidential. > > If you are not the > > intended > > addressee, any use, disclosure or copying of this > > email and any attachments > > is > > unauthorised - please notify the sender by return > > and delete the message. > > Any > > representations or commitments expressed in this > > email are subject to > > contract. > > > > ntl Group Limited > > > > > > > > > --------------------------------------------------------------------- > > > > Home : > > http://groups.yahoo.com/group/active-server-pages > > > --------------------------------------------------------------------- > > Post : [email protected] > > Subscribe : > > [EMAIL PROTECTED] > > Unsubscribe: > > [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > > > > > > > > > > _____ > > > > Yahoo! Groups Links > > > > > > * To visit your group on the web, go to: > > http://groups.yahoo.com/group/active-server-pages/ > > > > > > * To unsubscribe from this group, send an email to: > > [EMAIL PROTECTED] > > > <mailto:[EMAIL PROTECTED]> > > > > > > > > * Your use of Yahoo! Groups is subject to the Yahoo! > > Terms of Service > > <http://docs.yahoo.com/info/terms/> . > > > > > > > > > > [Non-text portions of this message have been > > removed] > > > > > > > > > > > > > --------------------------------------------------------------------- > > Home : > http://groups.yahoo.com/group/active-server-pages > --------------------------------------------------------------------- > Post : [email protected] > Subscribe : [EMAIL PROTECTED] > Unsubscribe: > [EMAIL PROTECTED] > --------------------------------------------------------------------- > > > ________________________________ > Yahoo! Groups Links > > To visit your group on the web, go to: > http://groups.yahoo.com/group/active-server-pages/ > > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- ---===/// The PogoWolf \\\===--- Amateurs built the ark, Professionals built the Titanic... BLOG: http://pogowolf.blogspot.com Xbox: Http://groups.yahoo.com/group/Xbox --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- --------------------------------- Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. [Non-text portions of this message have been removed] --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
