|
-
Aug 31st, 2012, 10:29 AM
#1
Thread Starter
Fanatic Member
[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?
-
Aug 31st, 2012, 02:59 PM
#2
Re: Working with Master page from the content page.
Code:
Quote.Attributes["Class"] = "Show";
-
Aug 31st, 2012, 06:52 PM
#3
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.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Sep 3rd, 2012, 03:59 AM
#4
Thread Starter
Fanatic Member
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.
-
Sep 5th, 2012, 05:46 PM
#5
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?
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Sep 14th, 2012, 10:40 AM
#6
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|