Avaricesoft’s Weblog

Just another WordPress.com weblog

Archive for July 8th, 2008

How To Define Mozilla Specific CSS

Posted by avaricesoft on July 8, 2008

Today I found a great approach for defining Mozilla specific styles without using Mozilla CSS extentions. The only thing needed is to put all Mozilla specific CSS definitions in a “@-moz-document” block and specify the url, url-prefix or domain to which pages the styles have to be applied:

@-moz-document url(http://www.w3.org/),
               url-prefix(http://www.w3.org/Style/),
               domain(mozilla.org)
{
  /* CSS rules here apply to:
     + The page "http://www.w3.org/".
     + Any page whose URL begins with "http://www.w3.org/Style/"
     + Any page whose URL's host is "mozilla.org" or ends with
       ".mozilla.org"
   */

  body { ... }
}

Browser compatibility
Available since Mozilla 1.8 / Firefox 1.5.

You can read more about this on Mozilla developer center website.

Now go and learn more about Mozilla CSS extentions.

regards,

www.avaricesoft.com

Posted in ASP.net | Tagged: , | Leave a Comment »

Gaia Ajax Widgets

Posted by avaricesoft on July 8, 2008

Gaia Ajax Widgets is another framework (except ASP.NET AJAX extensions framework) built on top of the native ASP.NET server controls.

Pros:

  • Easy to use
  • Easy to extend
  • Lightweighted
  • No JavaScript required – you don’t have to write JavaScript at all
  • Gaia is FREE

Samples
Download

regards,

www.avaricesoft.com

Posted in ASP.net | Leave a Comment »

Hide div and the white space it occupies

Posted by avaricesoft on July 8, 2008

Problem
Most of the developers will say “I can use javascript and CSS ‘visibility’ property to do that”, but shortly after that they’ll realize that this is not enough. This solution will hide the div tag content, but the space it occupies will stay.

You can reproduce this behavior using the code below:

if (objDiv.style.visibility == ‘visible’ ||
objDiv.style.visibility == ”)
{
objDiv.style.visibility = ‘hidden’;
}
else
{
objDiv.style.visibility = ‘visible’;
}

where objDiv is the div object which you’re trying to hide.

Solution

It’s simple – initialize “display” property in addition. So the above code will look like:

if (objDiv.style.visibility == ‘visible’ ||
objDiv.style.visibility == ”)
{
objDiv.style.visibility = ‘hidden’;
objDiv.style.display = ‘none’;
}
else
{
objDiv.style.visibility = ‘visible’;
objDiv.style.display = ‘block’;
}

regards,

www.avaricesoft.com

Posted in ASP.net | Tagged: , | 3 Comments »

Operator ===

Posted by avaricesoft on July 8, 2008

Have you ever used the strict equal operator? I learned about it few days ago…
Below is a quick explanation of its behavior:

“The strict equal to operator returns true if both operands are equal (and of the same type). It doesn’t perform any data type conversion, so an expression like 1 === true returns false and 1 === “1″ also returns false, because this operator checks for the type of the operands. 1 is a numerical value and “1″ is a string value; their types are different.”

regards,
www.avaricesoft.com

Posted in ASP.net | Tagged: , | 3 Comments »

Web Services Enhancements (WSE) 2.0

Posted by avaricesoft on July 8, 2008

Web Services Enhancements (WSE) 2.0

What is (WSE) ?
Web Services Enhancements 2.0 for Microsoft .NET (WSE) is a .NET class library for building Web services using the latest Web services protocols, including WS-Security, WS-SecureConversation, WS-Trust, WS-Policy, WS-SecurityPolicy, WS-Addressing, and WS-Attachments. WSE allows you to add these capabilities at design time using code or at deployment time through the use of a policy file.

Programming with WSE ?
The Web Services Enhancements for Microsoft .NET (WSE) provides access to features specified in the XML Web services architecture, also known as the Web services specifications, by building on the programming model for Web services created using ASP.NET. That is, WSE extends the programming model by introducing a SoapContext class and the WSE router. Through the SoapContext class, the developer primarily accesses the WSE implementation of the WS-Security and DIME Web services specifications. Likewise, the WSE router provides primary access to the WSE implementation of routing capability.

Run a WSE ?
WSE provides Visual Basic and C# versions of each sample. For most of the samples, there is a version that uses policy and one that uses code to illustrate the features of the sample. Choose the language and sample type to determine which sample to build.

using C#.net :

  1. <WSE2 Installation Directory>\v2.0\Samples\CS\Quickstart<SampleName>
  2. Default: C:\Program Files\Microsoft WSE\v2.0\Samples\CS\QuickStart


using VB.net

  1. <WSE2 Installation Directory>\v2.0\Samples\VB\Quickstart\<SampleName>
  2. Default: C:\Program Files\Microsoft WSE\v2.0\Samples\VB\QuickStart

Runing WSE ?

  1. Create a virtual directory for the Web service associated with the sample.
  2. For the QuickStart samples that use a Web service that is hosted in IIS, you must create a new virtual directory. To determine if a virtual directory is needed, navigate to the sample directory and check whether a file named CreateSampleVdir.vbs is present; if not, a virtual directory is not needed.
  3. Navigate to the sample directory.
  4. Double-click CreateSampleVdir.bat.
    This invokes a batch file that creates the virtual directory for the sample.
    If you want to manually create the virtual directory, you must add the virtual directory to the root of your Web site or change the sample code to point to the alternative location. The name of the virtual directory is the name of the directory containing the code for the Web service.
  5. Note: To remove the virtual directory at a later time, double-click DeleteSampleVDir.bat in the sample directory.
  6. Open the Visual Studio .NET 2003 solution file and build the Web service and client.
    1. On the Start menu, click My Computer.
    2. Navigate to <WSE installation folder>\v2.0\Samples\<Language>\QuickStart\<SampleName>\<SampleType>
      where <Language> is either CS or VB for the C# or Visual Basic version of the sample, respectively; <SampleName> is the name of the sample; and <SampleType> is either Code or Policy for the version that uses just the WSE classes or the one that uses policy.
    3. Double-click the Visual Studio .NET 2003 solution file (.sln).
    4. In Visual Studio .NET 2003, on the Build menu, click Build Solution.
  7. Run the client application for the QuickStart sample.
  8. You can run the sample from within Visual Studio .NET 2003 or from a command prompt, once the client and Web service executables have been created.

Regards,
Muhammad Kalim
muhammad.kalim@avaricesoft.com
www.avariecsoft.com

Posted in WSE | Tagged: , , | Leave a Comment »