Sunday, November 30, 2003 | |
Source: HumanCompiler - Erik Porter (.NET MVP) Blog Whitespace screwing up your Templating?. I worked yesterday on taking a layout for a client site made by my co-worker and moving it into a custom template (Inherit from BasePage, add menu and properties, etc) and ran into a problem with HTML being pretty horrible. As Adam put it, “who thought it would be a good idea to render whitespace?”. Good question...but we're unfortunately screwed for now. The problem we had in our case was having a carriage return (and maybe tabs and spaces) after the beginning of a div tag with and image and then a table in it. That extra white space left a small (maybe 4 pixel) gap above the table. Not good for this particular site layout. No problem, just remove the whitespace and butt the tags right up against each other. Now, move it into the template and it gets much harder to keep that whitespace from coming back, especially since the ASP.NET designer puts it back everytime you go into design view of one of the ASPX's. It's ok for us...we don't really need the designer, but our client may want to use it. They're new to .NET and might not understand what's going on, so why not make it so the whitespace is “ignored“. This is quick and dirty so there's probably a better way... Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs) m_Template.Content is a PlaceHolder where all the controls of the form are place for the template. All this code does is grab the first literal and remove whitespace at the beginning. There's probably some RegEx that's better than this, but I'm no RegEx expert! :P After this code is inserted into my base Page class, it doesn't matter what whitespace is on each page, it will be removed so there's no spacing problem. Hope someone gets some use out of this! :) [HumanCompiler - Erik Porter (.NET MVP) Blog]4:31:15 PM trackback [] Articulate [] |
Source: HumanCompiler - Erik Porter (.NET MVP) Blog I picked up the Microsoft MN-700 Wireless 802.11g Base Station Router and got it installed. The management interface is fantastic and easy to use. I seriously would've had it installed in 10 minutes if it wasn't for an error on my part (read the wrong MAC Address that my ISP requires me to use). It was super easy to setup everything I need like Port Forwarding so I can TS into my box from work if needed. It has 4 10/100 ports for your machines that don't have a wireless card in it (my main computer and my longhorn machine). It's backwards compatible with 802.11b so I can still connect to it with my TabletPC which has that built-in and is specially made to talk with the wireless adapter for XBox! :o If you're going to be setting up a wireless network at home, this is my recommendation...awesome! [HumanCompiler - Erik Porter (.NET MVP) Blog]4:19:21 PM trackback [] Articulate [] |
Source: How to Save the World
4:11:51 PM trackback [] Articulate [] |
Crimes against Nature I thought I was unhappy with President Bush before, then I read this article about the eviseration of the environmental laws by the current administration for the benefit of corporate polluters. http://www.rollingstone.com/features/nationalaffairs/featuregen.asp?pid=2154 10:50:15 AM trackback [] Articulate [] |