Tuesday, October 28, 2008
Trimming leading characters in Oracle
Back in February I posted about
concatenating values across multiple rows , and for those of you who have used that solution, you may have noticed that there are some leading slashes (or your delimiter of choice) that can be quite annoying. Another developer thought it looked sloppy so I trimmed off the leading characters.
The join and everything is the same as the previous article, the only thing that has changed is the select. Since there are no Left nor Right functions in Oracle we had to use substring as seen below:
SUBSTR(TYPELIST, (length(prj.TYPELIST) -2) * -1) as TYPELIST
Just change the 2 from above to however many characters you want to remove and you're all done.
Labels: Oracle
posted by Tom Becker at
|

Tuesday, October 21, 2008
Theming In .Net 2.0
Having a consistent look and feel for any web site is essential. It not only looks better when things are uniform, but it helps with user experience. If things look the same over the entire site they will learn and see patterns and provide for a better user experience over all. The move to using styles and CSS classes were a big step in the right direction by providing one place to update a style definition and it would bubble through the entire site. But what about specifics for a control in .Net? What if you want all of your gridviews to have paging set up a certain way? That is where skinning and theming come in. Applying a theme to a page will force all the controls on the page to display in a uniform way, and setting up a theme is very easy.
You can start by right clicking in the solution explorer in Visual Studio and adding a new ASP.Net folder called Theme and it will ask you the name for your theme. After that you will see two new folders in your project. One called 'App_Theme' that is built in by Microsoft. And a subfolder with the actual name of the theme you just provided. And in this folder is where you can add your skin. So right click on that folder and add a new item, and choose a skin file as the type. Once this opens you'll see that it has some comments at the top explaining how to use the skin file.
In here you can add any control that you can add on a control page. But why Microsoft decided not to have Intellesence on this file is beyond me. So after you have added all the controls that you want skinned, you can add the theme to your web.config file, or if you have multiple themes for a site you can define the theme in the page directive of each page.
I have included an example below of how my gridview generally looks in the skin file. As you can see you have a lot more options than you would if you were just using a CSS style.
<asp:GridView runat="server" BorderWidth="0" BorderStyle="None" CellSpacing="0" CellPadding="4" AutoGenerateColumns="False"
AllowSorting="True">
<headerstyle cssclass="HeaderStyle">
<rowstyle cssclass="RowStyle">
<alternatingrowstyle cssclass="AlternatingRowStyle">
<selectedrowstyle cssclass="SelectedItemStyle">
<editrowstyle cssclass="EditRowStyle">
<footerstyle cssclass="FooterStyle">
<pagerstyle cssclass="PagerStyle">
</asp:GridView>
With every rule however there are times when you are going to want to break the skin. You can do this on the page level by blanking out theme in the page directive, or you can do this at the control level. Below is an example of a button that I have a different style for than the rest of the buttons on the page. Notice the EnableTheming="False" is what actually does it. Remember that after this you will have no styles on this button, so remember you must set everything that you may have set in the theme.
<asp:Button ID="btnClear" Text="Clear" EnableTheming="False" CssClass="Button Clearbtn btn100" CausesValidation="False"
runat="Server" />
Labels: .NET
posted by Tom Becker at
|

Friday, October 3, 2008
Peek-a-boo bug
So you can find the solution to this fun little IE bug everywhere on the web, but for some reason I always forget the fix for it. So I figure if I actually write it out here maybe I'll remember it. Or at least know where to find it, with in a few clicks.
So with my latest searching
here is the page that helped me. But below is the code that worked for me.
position: relative;
It is pretty simple, no? Just put that on your p-tag or your div or whatever isn't showing up and like magic, poof, it is back in the world of the living. Still I don't know why I never remember the fix when I am looking at my code and see the text I just typed in but in IE, the text doesn't show up unless you highlight it.
Labels: CSS
posted by Tom Becker at
|
