Results 1 to 6 of 6

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

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    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 2002
    Location
    Eygelshoven
    Posts
    1,611

    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

    Free online tools

  3. #3
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    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.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    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 2006
    Location
    Greece
    Posts
    6,763

    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?
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    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
  •  



Click Here to Expand Forum to Full Width