Results 1 to 6 of 6

Thread: [RESOLVED] Working with Master page from the content page.

  1. #1
    Fanatic Member
    Join Date
    Feb 00
    Location
    Dunmow,Essex,England
    Posts
    892

    Resolved [RESOLVED] Working with Master page from the content page.

    Hi All,

    I have the following in my master page:

    Code:
    <span id="Quote" class="hide">..........
    In my code behind on the content page of page load I want to change the class="hide" to class="show" How can I do that?

  2. #2
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 02
    Location
    Eygelshoven
    Posts
    1,556

    Re: Working with Master page from the content page.

    Code:
    Quote.Attributes["Class"] = "Show";
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

  3. #3
    King of sapila
    Join Date
    Oct 06
    Location
    Greece
    Posts
    3,508

    Re: Working with Master page from the content page.

    Easiest way, put a runat="server" to your span and in page load do:
    Quote.Attributes.Add("class", "Show") .
    But i must ask why you want to change your class in page load?Doesn't make sense to me.
    Slow as hell.

  4. #4
    Fanatic Member
    Join Date
    Feb 00
    Location
    Dunmow,Essex,England
    Posts
    892

    Re: Working with Master page from the content page.

    Ok I have added a runat="server" to my span in the master page.
    In the contentpage aspx file I have added a MasterType with VirtualPath set.

    In the page_load event of my content page, when I enter the id of the span class "Quote" I get no intellisense and a red line stating that Quote doesn't exist in the current context.

  5. #5
    King of sapila
    Join Date
    Oct 06
    Location
    Greece
    Posts
    3,508

    Re: Working with Master page from the content page.

    Ye you got me confused now.You add the span in your master page and you expect it to be found in another page?Or what?
    Slow as hell.

  6. #6
    Fanatic Member
    Join Date
    Feb 00
    Location
    Dunmow,Essex,England
    Posts
    892

    Re: Working with Master page from the content page.

    I forgot to put in the MasterType directive in the aspx page

Posting Permissions

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