Mozilla plans to release Firefox 3 on Tuesday , 17 June 2008.
Firefox 3 Release Candidate 3 is available in more than 45 languages as a public preview release intended for developer testing and community feedback.
Features in FireFox 3 (What's New in Firefox 3)
->One-click site info
->Malware Protection
->New Web Forgery Protection page
->New SSL error pages
->Anti-virus integration
->Secure add-on updates
->Add-ons and Plugin version check
->Full page zoom
->New Download Manager
->Save what you were doing
->Text selection improvements: multiple text selections can be made with Ctrl/Cmd; double-click drag selects in "word-by-word" mode; triple-clicking selects a paragraph.
And many more very useful features. For more Feature FireFox 3.Just Download FireFox 3 and enjoy it.
Google Search
Tuesday, June 17, 2008
Mozilla : FireFox 3
Tags : Firefox 3, FireFox 3 Feature, Mozilla
Wednesday, May 28, 2008
Site Navigation using SiteMapPath control in ASP.Net 2.0
This article explains how to do site navigation for your web site
Introduction
Asp.net 2.0 has cool control for site navigation is SiteMapPath control.You can find SiteMapPath control in the Toolbox under the Navigation category.Using this control you can find where are you in this website.
First Add Web.sitemap in your project.Web.Sitemap has Title,Url and description attributes.like this,
Site Map
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/Default.aspx" title="Home" description="Home">
<siteMapNode url="~/InsideUs.aspx" title="Inside Us" description="">
<siteMapNode url="~/VisionMission.aspx" title="Vision & Mission" description=""/>
<siteMapNode url="~/Culture.aspx" title="Culture" description=""/>
<siteMapNode url="~/Trust.aspx" title="Trust" description=""/>
<siteMapNode url="~/BusinessPriciples.aspx" title="Business Principles" description=""/>
</siteMapNode>
<siteMapNode url="~/contactus.aspx" title="Contact US" description="Contact US"/>
<siteMapNode url="~/aboutus.aspx" title="About Us" description="About Us"/>
</siteMapNode>
</siteMap>
Master Page for the application
Now add the master page in your project and then drag and drop the SiteMapPath control.like this,
<asp:SiteMapPath ID="SiteMapPath1" runat="server" Font-Names="Verdana" Font-Size="0.8em" PathSeparator=" : ">
<PathSeparatorStyle Font-Bold="True" ForeColor="#5D7B9D" />
<CurrentNodeStyle ForeColor="#333333" />
<NodeStyle Font-Bold="True" ForeColor="#7C6F57" />
<RootNodeStyle Font-Bold="True" ForeColor="#5D7B9D" />
</asp:SiteMapPath>
The SiteMapPath control will automatically bind itself to the Web.sitemap file.If you use default SiteMap provider will
automatically be used by SiteMapPath control and also you can set the SiteMapProvider property of SiteMapPath control.
Now when you are on Culture.aspx page then SiteMapPath control display like, Home : Inside Us : Culture
So you can easily go from "Culture" page to "Home" page or "Inside Us" page (root node) using SiteMapPath Control.
Here,I set PathSeparator property of SiteMapPath control to : by default is >.
PathDirection property use for in which direction you want to display link.CurrentToRoot display link start from current node to Parent node like Culture : Inside Us : Home.And other is RootToCurrent display link start from Parent node to Current node like Home : Inside Us : Culture.
How to create Menu based on Sitemap and Roles
The following code sample shows how to create Menu based on Sitemap and Roles.
The combination of ASP.NET role management and ASP.NET URL authorization provide
a way to restrict access to Web files based on security roles.
Security trimming is a very cool feature which allows you to hide the urls based
on the users roles.
First create Web.sitemap in website also add roles for access url.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/Default.aspx" title="Home" description="Home">
<siteMapNode url="~/contactus.aspx" title="Contact US" description="Contact US" />
<siteMapNode url="~/aboutus.aspx" title="About Us" description="About Us" roles="*"/>
<siteMapNode url="~/articles.aspx" title="Articles" description="Articles"/>
<siteMapNode url="~/admin.aspx" title="Admin" description="Articles" roles="Admin"/>
</siteMapNode>
</siteMap>
In above site admin.aspx is display only to person who has Admin role.and roles
"*" means display for everyone.
Now,define sitemap providers in web.config file and enable security trimming
(securityTrimmingEnabled is set to true ).
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers> <add name="UserMenuSiteMap" description="Used for Menu"
type="System.Web.XmlSiteMapProvider" siteMapFile="Web.siteMap" securityTrimmingEnabled="true"/>
</providers>
</siteMap>
Menu based on Sitemap
For creating menu based on sitemap,Firstly create Web.sitemap (Define Sitemap).Web.Sitemap has Title,Url and description attributes.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/Default.aspx" title="Home" description="Home">
<siteMapNode url="~/contactus.aspx" title="Contact US" description="Contact US"/>
<siteMapNode url="~/aboutus.aspx" title="About Us" description="About Us"/>
<siteMapNode url="~/articles.aspx" title="Articles" description="Articles"/>
</siteMapNode>
</siteMap>
Then,in master page or .aspx drag and drop asp.net control and SiteMapDataSource.And set menu DataSourceID property to SiteMapDataSource.
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#7C6F57" Orientation="Horizontal" StaticSubMenuIndent="10px" BackColor="#F7F6F3" DynamicHorizontalOffset="2" StaticDisplayLevels="2"></asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
When you required Horizontal or Vertical menu then just set Orientation property of menu.By default this property set to Vertical.
In code we use DynamicHorizontalOffset property of menu to Gets or sets the number of pixels to shift a dynamic menu horizontally relative to its parent menu item.
In code we use StaticDisplayLevels property of menu to specify the number of menu levels to display in a static menu.
Find Nth highest salary from table
In interview you can faced question like to give solution(query) for find Nth highest salary from given employee table.
TO find out 3rd highest salary from table
--Find 3rd highest salary
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP 3 salary
FROM tblSalary
ORDER BY salary DESC) S
ORDER BY salary
General form to find to Nth highest salary from table
--Find Nth highest salary
SELECT TOP 1 salary FROM (
SELECT DISTINCT TOP N salary FROM tblSalary ORDER BY salary DESC) S
ORDER BY salary
There are many solution to solve to this but above solution is easiest.
Take other possible solution,
SELECT MIN(salary) FROM tblSalary WHERE salary IN
(SELECT DISTINCT TOP 3 salary FROM tblSalary ORDER BY salary DESC)
--or--
SELECT MIN(salary) FROM
(SELECT DISTINCT TOP 3 salary FROM tblSalary ORDER BY salary DESC) S
Tags : SQL, Tips -Tricks
Thursday, April 3, 2008
LINQ Introduction
Language Integrated Query (LINQ), a new query language feature in .net 3.5.
You can use it to retrieve data from an array or collection or any data source that supports IEnumerable or IQueryable.
Let's see example how to use LINQ in string array.We have string array of country like this,
Dim countries As String() = {"Australia", "Brazil", "China", "Japan", "India", "United States", "United Kingdom"}
Dim data = From country In countries Where country.StartsWith("Uni") Select country.ToUpper
Response.Write("Country List</br">")
For Each country As String In data
Response.Write(country & "</br">")
Next
Here, you have only change "LINQ Query" with query that discuss below.
==> By using LINQ you can retrive data from array. Below LINQ equivalent to SELECT * statement of SQL Server.
From country In countries Select country
==> You can also use conditional statement in array to get data.To retrive country list that have string length less than 6.
From country In countries Where country.Length < 6 Select country
==> You can also sort an array Ascending/Descending.
From country In countries Order By country Descending Select country
==> To retrive Country name that start with "UNI" and country name in Upper case.
From country In countries Where country.StartsWith("Uni") Select country.ToUpper
Here, I have explain how use LINQ.
Tags : LINQ
Tuesday, February 26, 2008
Enable/Disable RequiredFieldValidator with Javascript
Sometimes we need to Enable or Disable validation on client side.For that use ValidatorEnable function in the Asp.net javacsript Script Library.
For that set EnableClientScript property of validator to True.
Here i give example for this:
I have a page with a couple of radio buttons.On radio button selection i want to enable/disable validation.
In example if i select Email radio button then Email div will display and only txtEmail textbox validator is enabled.
Java Script for this:
<script language="JavaScript" type="text/javascript">
function autoSelect(control,type)
{
if(type=="Email")
{
document.getElementById('Email').style.display="block";
document.getElementById('PhoneNo').style.display="none";
ValidatorEnable(document.getElementById("RequiredFieldValidator1"), true);
ValidatorEnable(document.getElementById("RequiredFieldValidator2"), false);
}
else
{
document.getElementById('Email').style.display="none";
document.getElementById('PhoneNo').style.display="block";
ValidatorEnable(document.getElementById("RequiredFieldValidator1"), false);
ValidatorEnable(document.getElementById("RequiredFieldValidator2"), true);
}
}
</script>
Code for this:
Email :
<input type="radio" id="RadioButton1" runat="server" value="Plan1" name="Plan" onclick="autoSelect(this,'Email')" checked />
PhoneNo :
<input type="radio" id="RadioButton2" runat="server" value="Plan1" name="Plan" onclick="autoSelect(this,'PhoneNo')" />
<div id="Email">
Email <asp:TextBox ID="txtEmail" runat="server" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Email Required"
ControlToValidate="txtEmail" EnableClientScript="true" ValidationGroup="vgSubmit" />
</div>
<div id="PhoneNo" style="display:none">
PhoneNo <asp:TextBox ID="txtPhoneNo" runat="server" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="PhoneNo Required"
ControlToValidate="txtPhoneNo" EnableClientScript="true" ValidationGroup="vgSubmit"/>
</div>
<asp:Button ID="btnSubmit" runat="server" Text="Button" ValidationGroup="vgSubmit"/>
Tags : Ajax Control, Tips -Tricks