CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_forms Tags:
Item Type: NewsGroup Date Entered: 2/15/2007 4:26:23 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 0 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
7 Items, 1 Pages 1 |< << Go >> >|
rdove84
Asp.Net User
Hide table when certain pages are viewed2/15/2007 4:26:23 PM

0/0

The website I maintain is assembled using ASP.NET v1.1. Currently the sites content pages are displayed within static header, left navigation, and footer pages. The left navigation menu runs dynamically and below it is a table containing contact information for some key personnel. I have recently been asked to hide that contact information when certain content pages are viewed. Is this possible? Can it be done in the code behind or would I have to use something like javascript?

rdove84

 

stevenbey
Asp.Net User
Re: Hide table when certain pages are viewed2/15/2007 5:20:54 PM

0/0

You can use CSS to hide the table. For example:

<table style="display:none;">

 You then need some method of setting this when the appropriate pages are viewed. To do this you can insert a Code Render Block to assign the appropriate value (i.e. block or none). For example: 

<table style="display:<%= ShowContacts ? "block" : "none" %>">
 
The ShowContact is a property, in CodeBehind, that would perform some logic to assess if the page being requested should display the contact details.


Steven Bey

Recursion: see Recursion
rdove84
Asp.Net User
Re: Hide table when certain pages are viewed2/15/2007 6:37:18 PM

0/0

Thank you. A question for clarification:  If I set the display to block for example then in the code behind for Show Contacts all I need to do is set those pages where the code should be hidden?

rdove84

stevenbey
Asp.Net User
Re: Hide table when certain pages are viewed2/16/2007 11:15:56 AM

0/0

A simple way to do this is the following:

 
protected bool ShowContacts
{
    get
    {
        Type page = Page.GetType();
        return page.Equals(typeof(MyPage)) || page.Equals(typeof(MyOtherPage));
    }
}
 
Note that MyPage and MyOtherPage are the class names of your CodeBehind.
 

Steven Bey

Recursion: see Recursion
rdove84
Asp.Net User
Re: Hide table when certain pages are viewed2/16/2007 5:15:43 PM

0/0

Thank you so much for your assistance. I actually stumbled on a different solution when I realized I could use the section id setup called directly from the page load event of the page in question. Here's what I wound up doing in case someone can use this:

 On the table I made sure it had the following:

<table id=contact runat=server>

In the code behind I set up the following under the public class:

protected System.Web.UI.HtmlControls.HtmlTable contact;

and under Page Load I set the switch to read:

switch(pageID)
{
     case "137":
         contact.Visible=false;
         break;
     case "158":
         contact.Visible=false;
         break;
     case "159":
         contact.Visible=false;
         break;
     default:
         contact.Visible=true;
         break;
}

stevenbey
Asp.Net User
Re: Hide table when certain pages are viewed2/17/2007 11:18:37 AM

0/0

The reason why I didn't suggest that solution was because one of the ASP.NET Best Practices is to use Server Controls sparingly and not unnecessarily. However, if that is your preferred solution then fair enough.

Steven Bey

Recursion: see Recursion
rdove84
Asp.Net User
Re: Hide table when certain pages are viewed2/17/2007 3:56:59 PM

0/0

I did not think about that. I was having an extremely difficult time get the controlName of the page requested to be trasferred to the code behind so that it could be acted upon and their were a fair amount of pages that were to be affected, about 30. In the end, it seemed better to act off of the code already located in the page load event and prevent by page section rather than by individual page.

Once again, thank you for giving me some insight on this issue.

 rdove84

7 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Using Microsoft Office XP Authors: Ed Bott, Woody Leonhard, Pages: 1158, Published: 2001
How to Do Everything with Google Tools Authors: Donna L. Baker, Pages: 438, Published: 2007
Office 2001 for Macintosh: The Missing Manual Authors: Nan Barber, David Reynolds, Pages: 637, Published: 2001
Microsoft Outlook 2007 Bible Authors: Peter G. Aitken, Pages: 594, Published: 2007
Adobe Acrobat 6 PDF For Dummies Authors: Greg Harvey, Pages: 408, Published: 2003
Office X for Macintosh: The Missing Manual Authors: Nan Barber, Tonya Engst, David Reynolds, Pages: 728, Published: 2002
The Internet Encyclopedia Authors: Hossein Bidgoli, Pages: 0, Published: 2004
Quality Web Systems: Performance, Security, and Usability Authors: Elfriede Dustin, Jeff Rashka, Douglas McDiarmid, Pages: 318, Published: 2001
Production for Graphic Designers Authors: Alan Pipes, Pages: 272, Published: 2005
Microsoft Office 2007 in Depth Authors: Ed Bott, Woody Leonhard, Pages: 1056, Published: 2008

Web:
help.mambo - Table - Content Section Nov 30, 2005 ... The Table - Content Section Menu Item adds a link that will display a list ... the bottom of the page and return the user to the previously viewed page. ... Table Headings: Show/Hide on the section’s category pages the ...
 DOES  Show/hide table of contents;. Take notes;Show bookmarks. Table of contents .... c. Go to page number or viewed pages. Table of contents. Search terms ...
Amazon.com: Hillsdale Old World Hide-Away Table Desk, Brown/Cherry ... This Hillsdale hide-away table carries a limited one-year warranty. .... You have no recently viewed items or searches. After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you ...
Free viewed Download - viewed Script Software Ever wonder which link was clicked in order to get them to a certain page? ... Ever wondered how to create a table, view or procedure with MS Access? ... Hide show. Download Print View (From a db template). Web pages usually print ...
Menu Format - Table Content Section Category List - Category: Show/Hide the list of categories in Table view page. ... The category descriptions are defined on the category pages, which are ...
Different Table Captions on Multiple Pages (Tips.Net) This will hide the text on the first page of the table but not on subsequent pages. Tip #3417 applies to Microsoft Word versions: 97 | 2000 | 2002 | 2003 | ...
Item 000021 Detail Hide Details. Item: 000021. Viewed: 645 times. Comments: 3 (view). Topics:. Navigation; Training ... Table of contents and front matter. 8 pages; PDF (.pdf) ...
Privacy Codes - How to Hide Certain Areas on Myspace If you don't want a stranger sending you a friend request or a private message, there are 'hide contact table codes' that you can use as well. ...
Maintaining Pages Using Typo3 Typo 3 Backend. 7.1 Tool bar. 7.2 Browsing the site (hide/unhide pages) ... which it is viewed. This way the means of presentation can be controlled independent ... ULCC Content Management System: Maintaining Pages in Typo3. 5.2. 5 Table ...
YouTube - AMAZING TABLE TENNIS BATTLE Honours: #58 - Most Viewed (All Time) - Sport #29 - Top Favourites (... ## OVER 1 MILLION VIEWS ## Here is a video from a exhibition game. .... Help Change this to see only comments above a certain value. ... aseriousoffender (1 day ago) Show Hide. 0. Marked as spam ... Pages: 1 2 3 ... View all 1374 comments ...

Videos:
www.moldytoaster.com is time he gazed at him with so sombre an air that Thenardier decided that it was "useless" to proceed further. Thenardier retraced his steps ...




Search This Site:










permission layers

developing and testing pas

type conversion problem

difference between tabmodulesettings[] and settings[]?

how to detect(tst) primary keys violation

new fckeditor2 html editor provider with source.

articles project !

webstone shadow for dnn3?

best blog module for dnn 2.1.2

module superweather: information

error: parameter count does not match parameter value count.

dnn explorer 1.1.5

using file uploads

searching for a simple download module

error installing dotnetnuke

load content pane module from let pane module url in dnn3

can anyone let me know the module detail used in dotnetnuke.com!

inventua dnn sidemenu v1.1 released

sql server express 2005

solpart menu token settings

where can i find the enhanced page options module

how to use the calendar pop-up like the other pages in dnn?

sodablue discussion forums v1.1(in c#)

custom module in delphi 8 ?

dnn3.1 bug? issue: exception upgrading vs new install of module

iewebcontrols : tabstrip not working

login redirect module

forum integration

excel spreadsheet module

user portfolio module?

  Privacy | Contact Us
All Times Are GMT