ASP.NET Custom role provider

Easy guide to write your custom role provider

Merge splitted .mkv files

Learn how to merge splitted .mkv files (.mkv001,.mkv002...)

How to Zoom in and Zoom out your sql execution plan ?

Tool to tune your sql query

send .exe files with gmail

How to send files having blocked extension with Gmail ?

Multiple home pages in Internet explorer

How to set multiple home pages in internet explorer ?

9/25/2008

Google Project 10 to the 100th : Get your ideas noticed

Do you have some idea the can help someone or revolutionize some change ? A idea that can change the lives of people ? Are you thinking on How to get it noticed by the world and get some support to implement it ? You want someone to commit funding to your idea ?
There is someone who is ready to help you at this moment and that is none other than Internet Search Giant Google .Google has launched Google Project 10 to the100th on the eve of its 10th Birthday to fund ideas that can help as many people as possible.
What Google says about the project ?
helping helps everybody, helper and helped alike.

The question is: what would help? And help most?

At Google, we don't believe we have the answers, but we do believe the answers are out there. Maybe in a lab, or a company or a university - or maybe not.
Maybe the answer that helps somebody is in your head, in something you've observed, some notion that you've been fiddling with, some small connection you've noticed, some old thing you have seen with new eyes.

Your ideas can be from different categories which are listed below .
  • Community : How can we help connect people, build communities and protect unique cultures?
  • Opportunity : How can we help people better provide for themselves and their families?
  • Energy : How can we help move the world towards safe, clean, inexpensive energy?
  • Environment : How can we help promote a cleaner and more sustainable global ecosystem?
  • Health : How can we help individuals lead longer, healthier lives?
  • Education : How can we help more people get more access to better education?
  • Shelter : How can we help ensure that everyone has a safe place to live?
  • Anything else : Sometimes the best ideas don't fit into any category at all.
So what you have to do ?

All you have to do is Submit overview of you idea here by 20 October by filling the submission form.You can also attach a 30 second video to supplement your idea.Voting for 100 selected ideas will start from 27 January and the selected ones will be funded 10 million US dollars.So Friends , if you have any idea , try your luck here.
For more updates from tech world , Subscribe to Technova feed or click here to get updates via email .

9/22/2008

How to remove PDF document restrictions online?

Many of us come across Acrobat PDF documents which are locked by the authors so that you cant perform some actions on the file which may be copying ,printing or editing them .If you have any such document and if you want to remove restrictions on it freely, Go to the link below.


To unlock a PDF file, enter it's location in the "PDF file to unlock" field ( shown in the figure) , either manually or by clicking on the "browse" button.
Click on ' Submit ' and the unlocked version of the PDF will be displayed in a new browser window, opened in the default PDF application for your system (usually Adobe Acrobat Reader) .

Note that this utility works only for acrobat documents which are not read protected .

There is one more link which opens up your PDF file for editing.Visit PDF Filler.

Are you looking for some free desktop application to unlock your PDF document ? Then use PDF unlocker.


Once you complete the installation , just drag the .pdf file to the "PDF Unlocker " icon on desktop and Your restrictions will be removed.

Note : If a document is password read protected , For removing these restrictions , you need to know the password before hand.

9/18/2008

Google Chrome Review - My first impressions

Google Chrome is the latest web browser released by internet Search giant Google just a few days back with whom Google tried to bring the best of the existing browsers at a single place . You can download Google Chrome here.

The installation will be very smooth. Just Click the big blue button in the link above and you can download and install chrome in no time. It does migration just like as it used to happen with Firefox . It will import all your bookmarks, default search , your usernames and passwords... from IE and Firefox smoothly. Now you are ready to run the browser.

The browser loads pretty quickly compared to Firefox. But the amount of speed with which the page loads will be almost same as Firefox. The omnibar (Adress bar cum Search bar ) is what I like the most in Google Chrome ( I dont have to open Google everytime when I have to search).
There is no title bar in Google Chrome unlike IE and Firefox. And the home page in Google Chrome is a history of the pages you visited the most . This is pretty good feature for those who access some sites regularly and wants to access them in a click.

Most of the things like gears which we had to install separately earlier comes inbuilt with Chrome . The disadvantage for Chrome at this moment is that it don't offer extension capabilities unlike Firefox . I shifted to Firefox because of the Extensions and the tabbing feature both which are not offered by IE those days.Without them Chrome looks to me as a casual browser.

Chrome uses one process for each tab it opens . So even if a page crashes, only that page will closed not the browser.When you close a tab , the process of that tab is closed and the memory allocated is released. If you want to know more , you can check the Google Chrome Book .The DOM ( Document Object Model ) inspector in Chrome reminders me of Firebug through which you can inspect each and every element and, at the same time, traverse though the objects and see the styles aplied to each element. Just Right click on something in page and select ' inspect element ' and it shows CSS/HTML details. For achieving this we had to install Firebug Extension in Firefox.

The task Manager in Chrome is one more chilling feature.It displays plugins and each tab's network , CPU and Memory Usage.The inbuilt spell checker is also quite Helpful .Unlike Firefox where we have annoying popup for downloads , Downloads in Chrome happen in its taskbar with a cool animation in the start (A blue button pointing to the taskbar ).

Finally Chrome looks to me not so Special but as a effort by Google to unify the good features of the rest of browsers. I don't think many of the users might shift from Firefox and IE to chrome at this moment. May be if Google offers something extra ordinary , People might give it a try.

Join Technova Fans today !!!Subscribe to Technova feed or click here to get updates via email .

9/17/2008

Required Entries in web.config file for ASP.NET AJAX applications to run properly.

Before you start this , I recommending you reading ‘ How to remove 'Sys' is undefined ? ’

Following are the required entries in your web.config file for the ASP.NET AJAX applications to work with out errors. If you are integrating AJAX in your ASP.NET 2.0 application , then only you need to check this .If you are creating from AJAX Enabled website template in Visual Studio , these will be added automatically .

1.CONFIG Sections : For registering the system.web.extensions namespace, assembly and the various handlers that are used in handling AJAX requests.

<configSections>

<sectionGroupname="system.web.extensions"
type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
">

<sectionGroupname="scripting"type=
"System.Web.Configuration.ScriptingSectionGroup,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
">

<sectionname="scriptResourceHandler"type=
"System.Web.Configuration.ScriptingScriptResourceHandlerSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
"requirePermission="false"
allowDefinition="MachineToApplication"/>

<sectionGroupname="webServices"type=
"System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
">

<sectionname="jsonSerialization"type=
"System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
"requirePermission="false"
allowDefinition="Everywhere"/>

<sectionname="profileService"type=
"System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
"requirePermission="false"
allowDefinition="MachineToApplication"/>

<sectionname="authenticationService"type=
"System.Web.Configuration.ScriptingAuthenticationServiceSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
"requirePermission="false"
allowDefinition="MachineToApplication"/>

</sectionGroup>

</sectionGroup>

</sectionGroup>

</configSections>

2. In your system.web Node , Make sure you have these entries so that we can register the " asp " tag prefix to AJAX Controls .

<pages>

<controls>

<addtagPrefix="asp"namespace="System.Web.UI"assembly=
"System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
"/>

</controls>

</pages>

3. Now find
<compilationdebug="false> and add the following.This enables compilation of your website by referring to the following assemblies.

<compilationdebug="true">

<assemblies>

<addassembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
"/>

<addassembly="System.Web.Extensions.Design,
Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35
"/>

</assemblies>

</compilation>

4.Now to ensure that that your HTTP handler is registered and to specify that webservices might be handled by Async Callbacks (from JavaScript) Check for following lines or add them.

<httpHandlers>

<removeverb="*"path="*.asmx"/>

<addverb="*"path="*.asmx"validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
"/>

<addverb="*"path="*_AppService.axd"validate="false"type=
"System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
"/>

<addverb="GET,HEAD"path="ScriptResource.axd"type=
"System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
"validate="false"/>

</httpHandlers>

<httpModules>

<addname="ScriptModule"type=
"System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
"/>

</httpModules>

5.Now add the following after </system.web> tag.We add these lines to enable Json Serialisation or, authentication settings and some profile settings.Check for these lines or add them.

<system.web.extensions>

<scripting>

<webServices>

<!-- Uncomment this line to customize maxJsonLength
and add a custom converter
-->

<!--

<jsonSerialization maxJsonLength="500">

<converters>

<add name="ConvertMe" type=
"Acme.SubAcme.ConvertMeTypeConverter"/>

</converters>

</jsonSerialization>

-->

<!-- Uncomment this line to enable the
authentication service. Include requireSSL="true" if appropriate.
-->

<!--

<authenticationService enabled="true" requireSSL = "truefalse"/>

-->

<!-- Uncomment these lines to enable the profile service.
To allow profile properties to be retrieved and modified in
ASP.NET AJAX applications, you need to add each property
name to the readAccessProperties and

writeAccessProperties attributes. -->

<!-- <profileService enabled="true" readAccessProperties=
"propertyname1,propertyname2"

writeAccessProperties="propertyname1,propertyname2" />

-->

</webServices>

<!--

<scriptResourceHandler enableCompression="true" enableCaching="true" />

-->

</scripting>

</system.web.extensions>

6.Finally you have to register the script handler factory which will be done by the following lines.Check for them or add them to your web.config

<system.webServer>

<validationvalidateIntegratedModeConfiguration="false"/>

<modules>

<addname="ScriptModule"preCondition="integratedMode"
type
="System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
"/>

</modules>

<handlers>

<removename="WebServiceHandlerFactory-Integrated"/>

<addname="ScriptHandlerFactory"verb="*"path="*.asmx"
preCondition
="integratedMode"type=
"System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
"/>

<addname="ScriptHandlerFactoryAppServices"verb="*"
path="*_AppService.axd"preCondition="integratedMode"
type
="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
"/>

<addname="ScriptResource"preCondition="integratedMode"
verb
="GET,HEAD"
path="ScriptResource.axd"type=
"
System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35
"/>

</handlers>

</system.webServer>


Simple ain't it ? For getting Simpler solutions ,Subscribe to Technova feed or click here to get updates via email .

9/16/2008

How to remove 'Sys' is undefined ?

Many of my Co – developers who are trying to integrate ASP.NET AJAX into their applications are getting this error. Even newbies who start using ASP.NET AJAX run into this error. So before we start on How to remove ‘ Sys is undefined ‘ , let me throw a light on the possible outcomes which might result in this error ?

You might had observed the ASP.NET AJAX requires to have atleast one script manager on the page where you want to use it. The script manager will render various script tags from the AJAX libraries so as to initialize and run the AJAX scripts. If you try to view source code rendered by the browser , you will find something like this .

Sys.WebForms.PageRequestManager._initialize('ScriptManager1', document.getElementById('aspnetform'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(‘UpdatepanelControlsArray ’);

Note : Aspnetform, UpdatepanelControlsArray will be replaced by your page form ID and Update panelID’s separated by comma , you have on your page.

When the browser runs this code, it will expect Sys.WebForms.PageRequestManager to be defined somewhere already which happens to be in the AJAX library scripts that are loaded by the script manager.
If the browser fails to load those scripts, the script engine can’t find the definition for Sys, Sys.WebForms, Sys.WebFormsPageRequestManager, and returns the error ‘Sys’ is undefined .

Removing ‘ Sys ’ is undefined :

1.If the error is coming only in IE6 and not in other browsers ,There may be issue in compression of the scripts which will be handled by the Script resource handler. So make sure you have the latest version of AJAX Extensions and try turning off Compression in your web.config file as shown below .

<system.web.extensions>
<scripting>
<scriptResourceHandler enableCompression="false" enableCaching="true" />
</scripting>
</system.web.extensions>


2. Required Entries in web.config missing : Make sure your web.config contains the all the required entries for the AJAX to work. If you want to know required web.config entries for AJAX , Click here.

3. The virtual directory you are using for your web, may not be marked correctly as an application. Make sure you are using a web application and not just a IIS directory. In your IIS Manager right click on the virtual directory and click Convert to Application and you are done.

4. ScriptResource.axd requests return 404 :This happens as a result improper installation of ASP.NET. On a default installation of ASP.NET, any web request to a resource ending in .axd is passed from IIS to ASP.NET via an isapi mapping. Additionally the mapping is configured to not check if the file exists. If that mapping does not exist, or the check if file exists isn't disabled, then IIS will attempt to find the physical file ScriptResource.axd which if it is not able to find returns 404 error.

You can check to see if this is the problem by copy/pasting the full URL to ScriptResource.axd from the source which will be something like below and running it.

<script src="/YourWebApplication/ScriptResource.axd?[Some query string]" type="text/javascript"></script>

To fix this run "aspnet_regiis.exe" in Visual Studio command line tool to fix it up.You can run "aspnet_regiis -i -enable", which does the full registration of ASP.NET with IIS and makes sure the ISAPI is enabled in IIS6. You can also run "aspnet_regiis -s w3svc/1/root/ YourWebApplication " to fix registration of your web application.

For more solutions and Techworld Updates , Subscribe to Technova feed or click here to get updates via email .

9/15/2008

FTP Commands

A day back I was required to create a batch file for transferring some data from FTP to one of my servers using FTP commands .It has been long time that I worked with FTP and I was not able to recollect the commands .For those who find themselves in these kind of situation, I am listing few useful FTP commands . Note that the words in Square brackets are parameters whose description can be found in the Parameters column



Client Command
Description
Syntax
Parameters
!
Runs the specified command on the local computer
! [command]
Specifies the command to run on the local computer.
?
Displays descriptions for ftp commands.
? [command]
Specifies the name of the command to be described
append
Appends a local file to a file on the remote computer using the current file type setting.
append local-file [remote-file]
local-file - Specifies the local file to add.

remote-file - Specifies the file on the remote computer to which local-file will be added. If remote-file is not there, the local filename is used for the remote filename.
ascii

Sets the file transfer type to ASCII.
ascii
FTP supports two file transfer types, ASCII and binary image. ASCII should be used when transferring text files. In ASCII mode, character conversions to and from the network standard character set are performed
bell
Toggles a bell to ring after each file transfer command is completed. By default, the bell is off.
bell

binary
Sets the file transfer type to binary.
binary

FTP supports two file transfer types, ASCII and binary image. Binary should be used when transferring executable files. In binary mode, the file is moved byte-by-byte.
bye
Ends the FTP session with the remote computer and exits ftp.
bye

cd
Changes the working directory on the remote computer
cd remote-directory
remote-directory - Specifies the directory on the remote computer to change to.
close
Ends the FTP session with the remote server and returns to the command interpreter.
close

debug

Toggles debugging. When debugging is on, each command sent to the remote computer is printed, preceded by the string --->. By default, debugging is off.
debug

delete
Deletes a single file on a remote computer
delete remote-file

dir
Displays a list of a remote directory's files and subdirectories.
dir [remote-directory] [local-file]
remote-directory - Specifies the directory for which you want to see a listing. If no directory is specified, the current working directory on the remote computer is used.
local-file - Specifies a local file to store the listing. If not specified, output is displayed on the screen.
disconnect
Disconnects from the remote computer, retaining the ftp prompt.
disconnect

get
Copies a remote file to the local computer using the current file transfer type
get remote-file [local-file]
remote-file
Specifies the remote file to copy.
local-file
Specifies the name to use on the local computer. If not specified, the file is given the remote-file name.

glob
Toggles filename globbing. Globbing permits use of wildcard characters in local file or path names. By default, globbing is on.
glob

hash
Toggles hash-sign (#) printing for each data block transferred. The size of a data block is 2048 bytes. By default, hash mark printing is off
hash

help
Displays descriptions for ftp commands
help [command]
Specifies the name of the command about which you want a description.
lcd

Changes the working directory on the local computer. By default, the working directory is the directory in which ftp was started.
lcd [directory]
Specifies the directory on the local computer to change to. If directory is not specified, the current working directory on the local computer is displayed
literal
Sends arguments, verbatim, to the remote FTP server. A single FTP reply code is expected in return.
literal argument [ ...]
Specifies the argument to send to the FTP server.
ls
Displays an abbreviated list of a remote directory's files and subdirectories.
ls [remote-directory] [local-file]
remote-directory - Specifies the directory for which you want to see a listing. If no directory is specified, the current working directory on the remote computer is used.

local-file - Specifies a local file to store the listing. If not specified, output is displayed on the screen.
mdelete
Deletes one or more files on a remote computer.
mdelete remote-files [ ...]
Specifies the remote files to delete.
mdir
Displays a list of a remote directory's files and subdirectories. Mdir allows you to specify multiple files.
mdir remote-files [ ...] local-file
remote-files - Specifies the directory for which you want to see a listing. Remote-files must be specified; type "-" to use the current working directory on the remote computer.
local-file - Specifies a local file to store the listing. Type "-" to display the listing on the screen.
mget
Copies one or more remote files to the local computer using the current file transfer type
mget remote-files [ ...]
Specifies the remote file(s) to copy to the local computer.
mkdir
Creates a remote directory.
mkdir directory
Specifies the name of the new remote directory
mls

Displays an abbreviated list of a remote directory's files and subdirectories.

mls remote-files [ ...] local-file
remote-files - Specifies the files for which you want to see a listing. Remote-files must be specified; type "-" to use the current working directory on the remote computer.
local-file - Specifies a local file to store the listing. Type "-" to display the listing on the screen.
mput
Copies one or more local files to the remote computer using the current file transfer type
mput local-files [ ...]
Specifies the local files to copy to the remote Computer.
open
Connects to the specified FTP server
open computer [port]
computer - Specifies the remote computer to connect to. Computer can be specified by IP address or computer name (a DNS or HOSTS file must be available). If auto-login is on (default), FTP also attempts to automatically log the user in to the FTP server (see Ftp command-line options to disable auto-login).
port - Specifies a port number to use to contact an FTP server.
prompt
Toggles prompting. Ftp prompts during multiple file transfers to allows you to selectively retrieve or store files.
prompt

put
Copies a local file to the remote computer using the current file transfer type.
put local-file [remote-file]
local-file - Specifies the local file to copy.
remote-file - Specifies the name to use on the remote computer. If not specified, the file is given the local-file name.
pwd
Displays the current directory on the remote computer.
pwd

quit
div>Ends the FTP session with the remote computer and exits ftp.
quit

quote
Sends arguments, verbatim, to the remote FTP server. A single FTP reply code is expected in return. Quote is identical to literal .
quote argument [ ...]
Specifies the argument to send to the FTP server.
recv
Copies a remote file to the local computer using the current file transfer type . Recv is identical to get .
recv remote-file [local-file]
remote-file - Specifies the remote file to copy.

local-file - Specifies the name to use on the local computer. If not specified, the file is given the remote-file name.
remotehelp
Displays help for remote commands.
remotehelp [command]

Specifies the name of the command about which you want help. If command is not specified, ftp displays a list of all remote commands
rename
Renames remote files.
rename filename newfilename
filename - Specifies the file you want to rename.
newfilename - Specifies the new filename.
rmdir
Deletes a remote directory.
rmdir directory
Specifies the name of the remote directory to delete.
send
Copies a local file to the remote computer using the current file transfer type. Send is identical to put .
send local-file [remote-file]
local-file - Specifies the local file to copy.

remote-file - Specifies the name to use on the remote computer. If not specified, the file is given the local-file name.
status
Displays the current status of FTP connections and toggles.
status

trace
Toggles packet tracing; trace displays the route of each packet when running an ftp command.
trace

type
Sets or displays the file transfer type

type [type-name]

Specifies the file transfer type; the default is ASCII. If type-name is not specified, the current type is displayed.
user
Specifies a user to the remote computer.
user user-name [password] [account]

user-name - Specifies a user name with which to log in to the remote computer.
password - Specifies the password for user-name. If not specified, but required, ftp prompts for the password.
account - Specifies an account with which to log on to the remote computer. If account is not specified, but required, ftp prompts for the account.
verbose
Toggles verbose mode. If on, all ftp responses are displayed; when a file transfer completes, statistics regarding the efficiency of the transfer are also displayed. By default, verbose is on.
verbose