Sunday, April 7, 2013

Top websites for KEYWORD Research Analysis

Top websites for KEYWORD Research Analysis:

1. Word Tracker:

Its a paid and also one of famous keyword research tool. Initially they provide you with trial service.

2. Google Adwords Keyword Tool:

Its a Free Tool for keyword research. It has the facility of exporting the generated data into CSV format.

3. Wordze

Its a paid service. It gives you a very deep keyword search result.

4. Keyword Discovery:

Its a very simple tool. It will just show you the frequency of the keyword which is typed in our search engines.

5. SEM RUSH:
One of the best websites i have seen with regards to competitor website analysis. it will provide you a nice overview of a competitors website.

delegates in .net

What is delegate ?

Delegates are a function pointer which points to single or multiple methods. It behaves the same as the method to which it points.

Advantages of using Delegates:

1. Delegates are type safe objects.
2. It can helps us to accelerate simple reuse of code.
3. Can furnish an extraordinary measure of adaptability in your outlines.
4. Delegates are also useful during asynchronous programming.

Example:
Here i will show you how delegate is declared and used.

In Below image i have declared delegate called add and in the main class i have created the object for delegate pointing to method addmethod in class addmain.


Now in the void main method after creating this delegate object, we can see that its starts to behave like the method to which it points. hence we can pass the number of parameters same as to the parameters in method to which it points.

After Executing the project we get our desired result.



Friday, April 5, 2013

Ranking Function in Sql

There are four types of ranking function in sql server:

Lets take an example to explain this, First i will create a table called EmpDataDetails and then will insert some record into it.

Types of ranking function:

1.Row_Number:
It assigns rank sequentially. We can also use ranking according to partition.using partition we can break up the results into partitions as per the column selected in partition by. See below Example :


2. Rank : 
if the two values are same both gets the same rank. Then the following rank is skipped.



3. Dense Rank:
Its Behaves the Same as the Rank Function but the following rank is not skipped.



4. NTILE:

Divides into groups as per the Number specified in the NTile Function. if specified 2 it will divide into 2 groups.


Thursday, April 4, 2013

save file using html file control in asp.net

save file using html file control in asp.net :

In My Default.aspx page i have added this below html controls:

<input type="file" name="file"/> <!--Html file upload control-->
<input type="submit" name="Upload" value="Upload" /><!-- Submit Button -->

Add both of this above controls under the form tag of the html page. In form tag define the enctype,Method and action(URL).

Refer this below image for example, Here i'm providing the action url to the same page i.e. default.aspx.



















In default.aspx.cs page we will write the code to save the file in the application directory folder. Add using System.Web.UI.HtmlControls namespace in the codebehind. I'm saving my file in Temp folder which is in the application root directory. You can create folder or save in any of your existing folders.



Now run the application and select the file u want to upload. and click on upload button. File Uploaded Successfully message will be displayed. Still u confirm by checking the folder where u wanted to save your file.
















Select File to Upload

File Saved in the folder successfully


Check the folder were u wanted to save the file. Cheers !!



Wednesday, April 3, 2013

Call codebehind method from javascript in asp.net

Here i will show you how to call a codebehind method from javascript using Ajaxpro.

1. First go to http://ajaxpro.codeplex.com/releases/view/23363 website and download the Ajax.NET Professional Toolkit.

2. And also u should have Ajax control toolkit. To download go to this link http://ajaxcontroltoolkit.codeplex.com/ .

3. After downloading extract all the files, then go to your website--> Solution Explorer. Rightclick on your website in the solution explorer and goto add reference.
As given below in screenshots add reference of the AjaxPro.2.dll and AjaxControlToolkit.dll.







































4. Now goto your web.config file of the website and add <httphandlers> tag under the <system.web> tag

5. Then go to the codebehind page and add the required namespaces like shown below in the image and add this line on the page load event of the webpage.

AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default));

 where _Default is the class name.
We will write [Ajaxmethod] above the method name which has to be called from javascript code.















6. Finally go to aspx page register the AjaxControlToolkit namespace in the page header.
  <%@ Register TagPrefix="Ajax" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>

Now call the javascript function and inside it call the codebehind method.
For example: i have taken a button and on button_click i will call the javascript function inside this i will call the codebehind method to return a string with some message which i will display it in the alert box.






















7. Now run the project and finally u can see the message from the code-behind getting pop'd up in the alert box. Cheers!!