« A cool Javascript IDE | Main | Microsoft: .Net Beat Java, Who's Next? »

Comments

Scott

I have issues with master pages, certainly. I think the script issue is more difficult to solve than the CSS one (using class names instead of IDs is easy).

The problem with script is that there is no one "solution" that will fit everyone's needs, but once you know what is happening and what other approaches are available it's relatively easy to use script in master pages.

Carson McComas

Hi Scott, thanks for stopping by. And kudos, actually on that excellent Master Pages article (and all the other superb stuff you do).

To your point - I agree, sort of.

It *is* certainly harder to manage this with javascript (which is my primary beef) than CSS. But any time I have to compromise how I do the front end, because of some locked-in quirk on the back-end it's unacceptable in my mind.

But this issue commits a great sin. In order to "solve" this problem I have to tightly couple my front end, with my backend. And that is the completely unacceptable part.

That said, I've spent several days coming up with a solution I haven't seen elsewhere which will in fact resolve this issue without the tight coupling. It's still a hack for sure - but it's not as big an deal as writing custom controls (although it's close) and once it's done, it's cleaner to work with. I'll be posting about that soon (after I do some more testing and polishing).

Scott Allen

Hi Carson: I look forward to reading about your solution. A new approach is surely welcomed.

Azhar

Another problem with Master Pages is that for every submit , the entire page gets rebuilt. If the design divides the Web Page into Navigation Menu section and Content section. Then we only want the content section to refresh based on the menu selection instead of the entire page getting rebuilt on the server side. You may be able to design better and faster solution using IFRAMES instead of Master Pages

Chris

Thank you! I thought I was the only person who felt like this! In a shop of developers and designers, master pages just hoses up the werks. So thus far, we're just not using them.

Nate Tregillus

I am going to have to disagree with you. the concept of master pages is suppose to go hand-in-hand with the concept of skinning, & themes. With this you just give your controls a skinID and in your skins and themes folders you keep your images, and "css-like" skin files. This is a good approach because you can dynamically change the look and feel of your page just by referencing a different theme. This way you can give more flexibility to your users. All an element needs is a skinID attribute to inherit, just like css requires a class attribute. You can also assign default skin values for controls, so you don’t need a skinID.

As for the Java script issues, you shouldn't be writing direct javascript. If there is client side code, you should try to modularize your forms that implement the javascript, and have the javascript implemented via the RegisterClientScriptBlock object. That way all of your code appears in your codes files, and you don't mix aspx html with functionality code, further defining the difference between look and functionality.

Trying to mix and match master pages with Iframes can become trouble some. It's either Master Pages with Skins & Themes or IFrames with CSS, its just not valid to mix both together.

Hope this further defines the issue.

Nate

Carson McComas

Hi Nate, aside from advocating The Microsoft Way (which is dangerously proprietary, but your right) your paragraph about javascript is both nonsensical and puzzling and completely misses (or certainly doesn't address or solve for) the point in my post.

jgasm

I concur. Master Pages for the loss!

Jimi

Uh, I know this is an old post, what is wrong with the following?

var txt = document.getElementById("<%=txtMyControl.ClientID%>");

In my opinion, the use of master pages is a fair trade off considering the alternatives - a) a convoluted mess of user controls, b) a whole bunch of ugly HTML embedded in a base class, or c) repeating the same blocks of code for EVERY single page in your site.

Per my experience with CSS and master pages, I have never had any serious problems which would justify not using master pages.

I'm assuming by this point, since it's 3 years later, everybody here has smartened up a bit and figured out that master pages are quite useful, especially when you are talking about a system with 80-100+ pages.

Jimi

Carson

You're right, this is a REALLY old post. Long live MVC!

Benji

This is not an old post, but Jimi is advoating using old techiniques to solve common problems of Master Pages.

christian louboutin

the gray sea and the long black land;
  and the startled little waves that leap
  in fiery ringlets from their sleep,
  as i gain the cove with pushing prow,
  and quench its qpeed i’the slushy sand.
  then a mile of warm sea-scented beach;
  three fields to cross till a farm appears;
  a tap at the pane, the quick sharp scratch
  and blue spurt of a lighted match,
  and a voice less loud, through its joys and fears,
  than the two hearts beating each to each!

Nike Jordan Shoe

Happiness is the full use of your powers along lines of excellence.

Indian

I hate my life but at least this makes it beaarlbe.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

RSS Feeds

  • Link Snippets

Snippets

My Online Status