Thursday, March 6, 2014

JQUERY CALENDARS

JQUERY CALENDARS

DESCRIPTION:

             Using the following scripts the jquery pop up calendars can be easily placed on a webpage.

Here I have used some of the jquery pop calendars , you can use any one of this which suits to you!

Step 1:
Add the following "img folder", "css file" and the 'javascript files" to the solution explorer in vs2008.


Step 2:  On the header section of the html or aspx page add the source path as shown in below,




Step 3: Now add the required text box field










example:





***********************************************************************

Wednesday, March 5, 2014

DISABLE RIGHT CLICK USING JAVASCRIPT

DISABLE RIGHT CLICK USING JAVASCRIPT

DESCRIPTION:

       DISABLE THE RIGHT CLICK ON A WEBPAGE CAN BE DONE USING A JAVASCRIPT HOW EVER THERE ARE MANY WAYS WHICH WE CAN ABLE TO VIEW THE SOURCE,

 HERE I AM POSTING A SIMPLE JAVASCRIPT FOR THE DISABLE OF RIGHT CLICK ON YOUR WEBPAGE, IT CAN BE USEFUL FOR THE WEB APPLICATION WHICH RUNS UNDER WINDOW APPLICATION.



THIS JAVASCRIPT CODE WILL DISABLE THE RIGHT CLICK,

THIS PAGE IS AN EXAMPLE!!!!

Monday, March 3, 2014

COOKIES

COOKIES IN .NET

DESCRIPTION:

       The cookies are the collection of text to be stored on the user or clients computers and used by the websites when ever it want to reuse them.

Normally in web application it is required to maintain the users input for any website, cookies comes handy on that scenario.
In this example I would like to tell, how we can save the background color of user's choice.

The asp page contains the simple dropdownlist which each time gets postback when selected values are changed.

Step1: On the design page









It has 3 kinds of colors, when the selected value is changes the colorselected_indexchanged method will be executed, 

Step 2: On the code behind page



Now run the application and you will see the color you have choosen at first time remain saved on the webpage for an hour eventhough the page has been loaded everytime on sele.

Example: 



It will change after the given time expires.


Saturday, March 1, 2014

Authorization Concept in .net

Authorization Concept in .net

Introduction:

            In this article we going to know about the authorization concept in .net.
Authorization is a process of allowing or denying resources to the users.

To know more about checkout the example, I have used VS2008.

Step 1: create a website and on the solution explorer check the web.config file




Step 2:(For Application)
Now change the authentication mode to Forms" to apply the authorization concept, and also add authorization in system.web section to allow or deny users.


This will be used only for creating an application and give permission to some users to use like office use.

But at the same time if I have a website and need users to see registration webpage and other web page if they logged in, then we have to use the below code

Step 3:(For webpage)
     





 Still now we have seen how to allow authenticated users, now we going to see how to allow particular users

Step 4:(To allow particular users for application)





This will allow only 'ramanand" and restrict others.

Step 5:(To allow particular users for website)
    








As of now we have seen allow or deny anonymous users, now we going to learn how to apply this authorization concept for various roles users like admin












here,
I have two folders one is Administrator folder and another one is Customer folder. Now I want give permissions like Admin role users are able to access both the folders and Customer role users are able to access only Customer folder for that we need to set the condition like this in web.config file.

In this way we can use the authorization concept in asp.net and also note that before use deny we have to use allow tag!

Friday, February 28, 2014

SQL QUERY TO FIND NOT CONTAINS VALUES

SQL QUERY - NOT CONTAINS VALUES FROM TWO TABLES  AND SAME COLUMNS

DESCRIPTION:

             In my example I have used Toad SQL Server 2008 as a query analyser.

Objective:
            To obtain the not contains value of a two tables with same column name., if table A has a column city and table B has a column city, in this scenario we need to get the cities of table A which not contains in table B.

Table "A" contains


Table "B" contains



Now I need to get the cities from table "A" which not contains in table "B"

The query is,


and we get the result as shown in below,


Thank you!

Wednesday, February 26, 2014

autocomplete textbox using jquery

AUTOCOMPLETE TEXTBOX USING JQUERY

DESCRIPTION:

         THE TEXT BOX WITH AUTO SUGGESTION OR AUTO COMPLETE TEXT BOX CAN BE DONE WITH THE USE OF JQUERY 1.9.1 JS AND JQUERY UI 1.10.4.

STEP 1: CREATE A TEXT BOX WITH SOME NAME ANY ID.

STEP 2: NOW ON THE HEADER SECTION ADD THE FOLLOWING CODE


STEP 3:  AFTER ADDING THE STYLE AND SCRIPT ON THE HEADER SECTION ADD THE FOLLOWING SCRIPT IN BODY OR HEAD OF THE HTML, WITH THE NO. OF INPUTS FOR THE AUTO SUGGESTION TEXTBOX.



STEP 4:

ADD THE UI CLASS AS SHOWN BELO IN THE TEXTBOX TAG


NOW YOU HAVE DONE NOW TYPE AND SEE THE INPUT, FOLLOWING SHOWS THE RESULT OF MY EXAMPLE.





Monday, February 24, 2014

JQuery delay function

 JQuery time delay function

Description:

             Here we going to learn how to work on delay function using setTimeout function in jquery.

Execute time delay function refers the jquery plugin 1.8.2.js

Example:

Use the jquery plugin 1.8.2.js and add the source file to the script.
after that add the below script function to your program.



  here I have added label on my webpage which has a id lblTime.
here the setTimeout will execute the function after one minute
1000 = 1 Second.

******************************************************
     

Sunday, February 23, 2014

File Upload using JQuery plugin

FILE UPLOAD USING JQUERY PLUGIN

DESCRIPTION:
    
    Hi, in this blog we going to learn how to upload multiple files using jquery plugin. In this example I am using VS2008, and Jquery plugin 

You can download the plugin from uploadify plugin .

First need to add the css file and the js file we get from the above link, and check the aspx page where I declare in my aspx page and Create a folder in the solution explorer name it as UploadFiles.


 In the above example I have used ashx handler page this can be added by right click on your solution and from choose add item and select generic handler.

Now open the ashx page and add the code as below,


Thats all you have done!

Thursday, February 20, 2014

PASS OR SEND THE VALUE FROM HTML PAGE TO WEB SERVICE PAGE

Pass the value from html page to webservice page using javascript

Introduction
   
     Hi, today we going to learn how to pass the values from html page to web service page. This will be an important one to be learn for working on the web services related tasks or wit the api services.

Description

     A simple example will be provided here for the better understanding, to transfer the data of html controls follow the below steps.

Step 1:  Add the soapclient.js file in your project.

Step 2: Add the controls and values in web page, in my example I am adding one text area and one button, so that if I click the button the text area value to go to the web service and get the result back.






Step 3: No on the script page add the variables as shown in the below pic.










here, the go2service will work on the click event of button, the txtareavalue will have the textarea field Text values and the parameters will contains the parameters to be passed to  the webservice method.

servicefunction_callback will return the value received from the web service method.

And I am returning the value to the same text area field.

Step: 3 Add the function and parameter value must be same given in the script.



Here I have added simple method which will return the string value.


here is the example run video in gif format.



THANK YOU!

Monday, February 17, 2014

SHOW HIDE PASSWORD USING JQUERY

Using JQuery show hide password with a button

Introduction:

   The password text field sometime required a show hide password option that time we can make use of jquery plugins.

In my example I am using jquery 1.10.2 plugin.

Description:

   In my example I am using visual studio 2010, to begin the task first we need to create a html or aspx page with the necessary controls, ie., password text box and a button.

as shown below




here I am using two input type password and a textbox..
using hide and show we going to display the contents.

After designing we have to use the script as like BELOW,

Now, run the application and type the password and click the button it will show and hide according to the display of textbox.
******************************************************

Saturday, February 15, 2014

ASP PAGE LIFE CYCLE

ASP PAGE LIFE CYCLE

Introduction:

     The life cycle of an asp.net page can be understandable easily if you have a knowledge of some keywords like viewstatepostback and events in asp.net 

Description:

PreInit -

In preinit you can check weather the page is loaded first time             or  not using IsPostBack property.
* On the first time load page you can create control with values.
* You can set master page and theme dynamically.

* If the page is postback, you can set control property value to           be overwritten. 
 * The values have not been yet restored from viewstate.
     
Init -

* In the Init event of the individual controls occurs first, later               the Init event of the Page takes place.
 * This event is used to initialize control properties.

InitComplete -

* In the InitComplete event the viewstate property checking will be done and that changes will be persisted until next postback.

PreLoad -
* This will process the data on postback event with the request.

Load -
* In this process the initial Page controls or objects calls the OnLoad method and that method with any controls or objects comes next.

ControlEvents -

* This events occurs after page loads like onclick in button, textchanged in textbox, onchange in dropdownlist etc.

In case of the postback, 
if the page contains validator controls , the page.isvalid property and the validation of the control takes place before the firing of individual events.

Load Complete - 

* This session occurs after the event handling page.
* This will complete all controls and their methos events.

Pre Render -

This method is used to make final changes to the controls on the page like assigning the DataSourceId and calling the DataBind method.

PreRenderComplete -

* This event is raised after all the final id values are set in prerender completes.

SaveStateComplete -

* This will occur after control state and view state saved.

RenderComplete -

* This method writes the controls values or markup to the browser.

Unload -

* This event is raised for each control and then for the page.

* This will do the final clean up work and close dataconnection etc.,

If any clarification or need changes please comment.
Thank you!

     

SQL SELECT names between 2 characters in sql server table

Get names between 2 characters in sql server table

Introduction:

Just find out the names between two characters starting with characters a to d in a sql server datatable column.

Description:

      I have a name column as like below, 

Now I am going to select the names from the column whos names were starting from letter a to d.

Use 

Select * from names where name like '[a-d]%'

and this returns me the following result.



******************************************************

JQuery special character Identifier

Using JQuery _ find special character in a string or text box

Introduction:

                    Using JQuery we can find weather a string variable or a textbox contains any special characters or not.

Description:

Using the below example you can be easily apply the method to check weather  a string contains special characters or not, it will be useful for the name textbox.

Example:


Time difference in SQL SERVER

Find Time Difference of two  Dates using SQL SERVER


Introduction:

Here we going to learn how to obtain the difference of time in terms of sql query in sql server.

Description:

The time difference of two time can be a easy task in terms of sql server, today we going to learn how it can be achieved using simple sql  query.

In my example I am using Toad for SQL Server as a query analyser tool.

Thanks if you have any other doubts are questions please ask and share the knowledge!
Thank you for visiting my blog!

Friday, February 14, 2014

Overloading and Overriding in C#

Overriding and Overloading in C#

Hi, today we going to learn all about the overloading and overriding concepts in c# with example.

Description:

Before going to the overloading and overriding, we have to learn polymorphism, which is the one of the important concept of oops.

Poly means 'many' , morph means 'forms' hence, hence the polymorphism means ability to take many forms.

In polymorphism we can declare the same method name with different arguments in a class and same method name with same arguments in different classes. The polymorphism has the ability to provide different method implementation and that are with the same name.

We have two types of polymorphism, namely

Overloading and Overriding 

Overloading:

In overloading the same name with different signature can be used, thus provides us the benefit of using same name with different tasks. This is also called as compile time polymorphism .

Overriding:

In overriding the method name have same signature can be used in many class with the reference, hence at the runtime only the method and its signatures will be known to the clr.
This is also known as runtime polymorphism.

Overriding an be performed using virtual and override keywords.

Initially we need to create a method with the name virtual and when using the same method name we have to use override keyword.

*signature = parameters

example of overloading:


Example of overriding:



for more information refer my other posts too!
Thank you!

Friday, January 31, 2014

Javascript blinking Text

Javascript blinking Text

Hi, this is an  simple concept of making blinking text using simple javascript.

here , I am using  javascript function settimeOut(), using this we can set function to be called after certain delay, this function takes two arguments one is function another is time delay, 

Step1:

Add the below code in your head tag.
as posted image,


Step2: after this add the text in the body tag,




sample video:




thats it for any help post your response. thanks!!!!

Thursday, January 30, 2014

Email Sending Concept Using Asp.net with C#

Email Sending Concept with Asp.net and C#

Introduction:

                   Hi, today from this blog we are going to learn how to send emails using asp.net and c#.

Description:

                We normally use email providers like google, yahoo and soon for sending emails, here we going to see that type of email sending concept using asp.net using visual studio 2010.

Step1:

Add the System.Web reference to your project from add reference tab >> .Net tab >> System.Web dll.

Step2:

Create a Simple mail sending option design with asp form.




Step 3:

    On the code behind page add the following coding with the comment line remove the comment line.






Step4:

thats it, you have done! Now run the project and check the process...

For more updates visit my blog often, thank you!!