IE8 Beta 2 and Asp.net rendering issues

Asp.Net, Tips and Tricks October 20th, 2008

2
Digg me

IE8 Beta 2 and Asp.net Menu Control rendering issues

If your code works on IE 6,7 and Firefox even on chrome it may not work on IE8. The reason being Microsoft suddenly woke up and started to be strict with design and style standards.

For styles not working the way it should or DHTML not appearing on screen the problem is inline styling. IE 8 doesnt parse the code if its inline styling.

So the simple fix is move all the style=” “  to stylesheet class

This is better way to clean your code too.

If you enjoyed this post, make sure you subscribe to my RSS feed!

CSS Cleaner for asp.net apps

Asp.Net, Tips and Tricks October 20th, 2008

1
Digg me

I found this Freebie (not great interface though) which helped me to cleanup my stylesheet.

http://www.dotnetsurfers.com/Blog/ct.ashx?id=5eb69d72-b844-412a-9da2-ac8f21b5a714&url=http%3a%2f%2fwww.dotnetsurfers.com%2futils%2fcsscleaner.zip

Word of caution

By default this looks for .aspx,.ascx,.master files.

So before removing the unused class, please search the entire solution to make sure you haven’t used them in code behind files.

object.cssclass = “cssclassname”

Happy Style Cleaning !

If you enjoyed this post, make sure you subscribe to my RSS feed!

skmMenu 2.3 : Consolidated Post IE8, Firefox, Chrome

Asp.Net, skmmenu October 20th, 2008

1
Digg me

I have been fixing and updating skmMenu for sometime now. Thought of writing a consolidated post with all the fixes and sourcecode for easy reference. For skmMenu fans and for those who are migrating from 1.1 to 2.0, I have rebuilt the dll on 2.0 framework.

Based on this article by Chris , I have incorporated Javascript changes so that skmMenu works on FireFox, IE and Chrome.

Download skmMenu 2.3 - DLL

Download skmMenu 2.3 Source Code

 The project was checked out from Source Safe. You “may” experience Source Safe binding issues. Please ignore it and remove all the source safe bindings.

Wherever I have made the fix I have marked it as  //GC  with relevant comment next to it. Hope its easy to understand.

The changes are updated in “Readme.txt” file.

 skmMenu Version 2.3 (Bug-Fixes and Changes)

Fixed:
 Recompiled for framework 2.0 and fixed the obselete methods with new methods.
 Change javascript to work with IE 8, Firefox 2,3

Changed: Added <statusbar> to XML element
  Example: <statusbar> </statusbar>

  Added IE 8 (beta 2) support. As IE8 is doesnt like inline styling, two more stylesheet items needed to be added to your stylesheet.

  1. td.skmcur

  Example: td.skmcur{cursor:hand;}

  2. iframe.skm

  Example: iframe.skm {position:absolute;top:0px;left:0px;display:none;}

  Removed the auto generating z-index for submenu. Again IE 8 doesnt like inline styling. Its now done via css class.

Sample Menu Control (.aspx / .ascx)  (replace all [ & ] with < & > respectively)

 [cc1:menu id="Menu1" Layout="Horizontal" HighlightTopMenu="False" ItemPadding="0" ItemSpacing="1" runat="server" SubMenuCssClass="skmsubmenu"]
 [SelectedMenuItemStyle cssclass="skmSelMenuItem"][/SelectedMenuItemStyle]
[/cc1:menu]

Sample CSS  

iframe.skm {position:absolute;top:0px;left:0px;display:none;}

td.skmcur{cursor:hand;}

 

.skmsubmenu{ text-align : left; border : solid 1px #FBBD05;color:Black;
background-color:#FFEFC0;cursor:pointer; z-index:auto;
font-family : Verdana; font-size : small; font-weight : bold; width : 175px;line-height:20px;
vertical-align:middle;}

.skmSelMenuItem{background-color: #FBBD05

;} 

 

Screen Shots

 

IE 8

FireFox 3.01

IE 7.0

Google Chrome

Hopefully it works on all browsers from now on. Lets carry it to .net 4.0 too :)

If you enjoyed this post, make sure you subscribe to my RSS feed!

Asp.net Web application Deployment : Simpler Approach

Tips and Tricks, Web Coding October 16th, 2008

0
Digg me

When your project becomes big, deployment becomes very very painful.

If you are copying files manually from Development to Testing and from Testing to Production Server(s) its a nightmare.

I tried the setup project and it was time consuming to configure and make sure you have added all the related references for testing and production.

Finally went to good old DOS command (xCopy - suggested by Microsoft). Initially I was skeptical as it will copy the entire folder structure from development to testing or Production.

After reading more about xCopy realised it has very bunch of handy parameters which does our job exactly the way we wanted it to do.

Create A .bat file say Dev2Test.bat Click here to download file

1. @ECHO OFF
2. CLS
3. REM /S : Subdirectories
4. REM /Q : Quiet Donot display Filenames
5. REM /R : Overwrites Read Only File
6. REM /Y : Supress Prompting When Overwriting Existing File
7. REM /I : If Destination doesn’t Exist and copying more than One File, its assumed as DIRECTORY.

8. ECHO ‘Processing Local 2 Testing : Complete’
9. ECHO ‘Make sure Testing Server Directory is Mapped as Y:’
10. net use Y: \\yourserver.address

11. ECHO ‘Copying Local To Testing Directory… Please wait …….’

12. XCOPY C:\ProjectFolder Y:\ProjectFolder  /S /Q /R /Y /I  /EXCLUDE:ExcludeList.txt

13. ECHO ‘* * * * * * Copying Completed * * * * * * * *’
14. PAUSE

Lines 1 - 11 are self explanatory

Line 12 is the one which does the Magic

/Exclude:ExcludeList.txt Click here to download

contains all the extensions and folders which you want to exclude while copying.

One entry per line.

In my Excludelist.txt I have excluded the following files and folders.

.vb  - Code
.scc  - Visual Source Safe
.user  - Visual Source Safe
.vspscc  - Visual Source Safe
.resx  - Resource
.suo  - Visual Source Safe
.config  - web.config file (as it could be different for each environment)
.xml  - If you use GhostDoc for documentation
.sln  - Solution File
.vssscc  - Visual Source Safe
.pdb  - Gets created along with DLL (for production you dont need this)
.myapp  - Visual Studio File
.settings  - Visual Studio File
\My Project - Visual Studio Folder
\obj  - VS Folder
\bin  - As Visual Studio creates \bin for every subproject you create, I want to exclude this too.

I also have another Batch file which copies only the main Bin folder from Development to Testing / Production.

If you use XML Files, or Config Files then separate Batch files will be useful so that things dont get messed up.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Reset Wordpress Password in MySQL

Wordpress October 13th, 2008

1
Digg me

 

Wordpress uses MD5 encryption.

  1. Goto this site http://www.zappersoftware.com/Help/md5.php
  2. Enter your new password and submit
  3. Copy the MD5 value

Open MYSQL Client / PhpAdmin

UPDATE wp_users SET user_pass=”–your MD5 Generated Key”  WHERE user_login = ‘–your user name–’

If you enjoyed this post, make sure you subscribe to my RSS feed!

Free Wireframe | Template | Prototype Tools

Agile, Software Development, Tools, Wireframe October 6th, 2008

1
Digg me

Before every new Software development, people discuss a lot about prototypes / wireframes. Many times the enthusiasm dies after few days either because of lack of dedication or because of lack right tools to do the job.

I’m not here to discuss about lack of dedication. This post is about, using the right tools for the job.

These are the tools I have personally used and it serves my purpose.

1. Serena Prototype Composer

http://www.serena.com/products/prototype-composer/home.html

It’s complete software for traditional SDLC or for agile technique. It starts from requirement gathering to sample data.

On top of everything it’s FREE. (Why FREE they explain it here)

2. Pencil Project

http://www.evolus.vn/Pencil/Home.html

If you are want to do a quickie design or screen template here is the software. No need to install this software. Just works on clicking a .bat file.

It’s also available as a Firefox add-on.

3. Gliffy

It’s a web based (SaaS) tool. Even though its web, the toolset works great and I like the portability. It has Free Basic edition (with some document restrictions) and Professional edition without restriction.

http://www.gliffy.com/basic.shtml

If you enjoyed this post, make sure you subscribe to my RSS feed!

skmMenu 2.3 Source Code

Asp.Net, skmmenu October 2nd, 2008

1
Digg me

Click here to goto updated post on skmMenu 2.3

If you enjoyed this post, make sure you subscribe to my RSS feed!

Possible reason: your host may have disabled the mail() function…

Wordpress September 24th, 2008

1
Digg me

Wordpress Error Message : Possible reason: your host may have disabled the mail() function…

By default Wordpress uses Mail() component to send out emails. But if your host has secure SMTP eMail authentication then Mail() will not and you may see this error.

Solution for this problem is using wp-mail-smtp plugin. Its a very very simple plugin, which accepts smtp host, username & pwd and sends out email via SMTP host.

This plugin can be downloaded from here.

http://wordpress.org/extend/plugins/wp-mail-smtp/

If you enjoyed this post, make sure you subscribe to my RSS feed!

SQL Server Format Number - Function

Database, SQLServer 2005 September 24th, 2008

1
Digg me

This is simple function which can format a given number as Comma delimited number.

ex : 98712345 as 98,712,345

Thanks to http://siccolo.blogspot.com/

(Attached is the original code which works on SQL Server 2000 and SQL Server 2005.)

(download) formatnumber

I have slightly modified it for SQLServer 2005.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
– =============================================
– Author:
– Create date:
– Description:
– =============================================
– Verify that stored procedure does not exist.
IF OBJECT_ID (’fn_format_number’, ‘FN’ ) IS NOT NULL
    DROP FUNCTION fn_format_number

PRINT ‘Function fn_format_number is Deleted’
GO
CREATE FUNCTION fn_format_number (@int_value int ) returns varchar(20)
AS
BEGIN
 DECLARE @is_negative BIT
 SELECT @is_negative = CASE WHEN @int_value<0 THEN 1 ELSE 0 END

 IF @is_negative = 1
  SET @int_value = -1*@int_value

 DECLARE @return_value VARCHAR(20)
 SET @return_value = CONVERT(VARCHAR, ISNULL(@int_value, 0))

 DECLARE @before VARCHAR(20), @after VARCHAR(20)

 SET @before = @return_value
 SET @after=”

 – after every third character:
 DECLARE @i INT
 IF LEN(@before)>3
 BEGIN
  SET @i = 3
  WHILE @i>1 and @i < len(@before)
  BEGIN
   SET @before = substring(@before,1,len(@before)-@i) + ‘,’ + right(@before,@i)
   SET @i = @i + 4
  END
 END
 SET @return_value = @before + @after

 IF @is_negative = 1
  SET @return_value = ‘-’ + @return_value

 RETURN @return_value
END
GO
PRINT ‘Function fn_format_number is Created’
GO

If you enjoyed this post, make sure you subscribe to my RSS feed!

skmMenu 2.3 Google Chrome, FF 3.0.1, IE 7 (Sample Code)

skmmenu September 2nd, 2008

2
Digg me

Click here to for updated post on skmMenu 2.3

If you enjoyed this post, make sure you subscribe to my RSS feed!