Monday, 19 December 2016

Description:

In this example we explain that how set and get the innerHTML of the Label and DIV control using jQuery or JavaScript. Or how to replace the innerHTML of the div using jQuery or javascript.

how set and get the innerHTML of the Label and DIV control using jQuery or JavaScript

Description:

In this example we explain that how set and get the innerHTML of the Label and DIV control using jQuery or JavaScript. Or how to replace the innerHTML of the div using jQuery or javascript.

Monday, 21 November 2016

Delete Row with Confirmation in asp.net

Description:

In this example we explain that how to delete a row from grid view with confirmation message using code behind in asp.net.here we create confirmation dialog from code behind and delete or remove the rows from grid view.

Here we generate the button on click event from code behind and set the confirmation dialog box in asp.net.sometime we have requirement like to delete the rows based on row command button event with confirm dialog box at that time below code is very useful.

Delete Row with Confirmation in asp.net

Delete Row with Confirmation in asp.net

Description:

In this example we explain that how to delete a row from grid view with confirmation message using code behind in asp.net.here we create confirmation dialog from code behind and delete or remove the rows from grid view.

Here we generate the button on click event from code behind and set the confirmation dialog box in asp.net.sometime we have requirement like to delete the rows based on row command button event with confirm dialog box at that time below code is very useful.

Saturday, 19 November 2016

Lead is Qualified in Dynamic CRM
Description:


In this example we explain how to get the last created records when Lead is Qualified in Dynamic CRM using plug-in.or how to fetch or retrieve the created records when Lead is Qualified in Dynamic CRM using plug-in.

Sometimes you have requirement like when lead is qualified then you need some custom logic to work then at this time this scenario is very useful for you.
So below is the plugin code to retrieve or fetch the created record when Lead is Qualified in Dynamic CRM

Get the Created Records When Lead is Qualified in Dynamic CRM Using Plug-in

Lead is Qualified in Dynamic CRM
Description:


In this example we explain how to get the last created records when Lead is Qualified in Dynamic CRM using plug-in.or how to fetch or retrieve the created records when Lead is Qualified in Dynamic CRM using plug-in.

Sometimes you have requirement like when lead is qualified then you need some custom logic to work then at this time this scenario is very useful for you.
So below is the plugin code to retrieve or fetch the created record when Lead is Qualified in Dynamic CRM
This entry was posted in :

Saturday, 5 November 2016

Auto Calculate Age based on Date of Birth

Description:

In this example we explain that how to calculate age based on date of birth in dynamic crm using javascript.Auto Calculate Age based on Date of Birth in Dynamic CRM using javascript.i need to suto calculate age of the customer (contact entity) based on date of the birth.in this example when user change the date of birth at that time the age of the customer(contact) will be automatically calculated onchange of the date of birth event using javascript in dynamic crm.


you have to call this function on onload of the form & onchange of the birthdate so you can dynamically calculate your age as per birthdate.

Calculate Age based on Date of Birth in Dynamic CRM using javascript

Auto Calculate Age based on Date of Birth

Description:

In this example we explain that how to calculate age based on date of birth in dynamic crm using javascript.Auto Calculate Age based on Date of Birth in Dynamic CRM using javascript.i need to suto calculate age of the customer (contact entity) based on date of the birth.in this example when user change the date of birth at that time the age of the customer(contact) will be automatically calculated onchange of the date of birth event using javascript in dynamic crm.


you have to call this function on onload of the form & onchange of the birthdate so you can dynamically calculate your age as per birthdate.

Tuesday, 25 October 2016

How to call c# web Page_Load() in javascript function

Description:

In this example we explain that how to call Page_Load post back from JavaScript or how to call C# web Page_Load () in JavaScript function or raising post back using _doPostBack () function from JavaScript. Need to call Page_Load () method in JavaScript without clearing values in the pages. If we use JavaScript window.location.reload () then it will call page load () but clears all the value.so to overcome this problem here we create one hidden button in the web page and call its click event from the JavaScript so the page load will automatically call.

How to call c# web Page_Load() in javascript function

How to call c# web Page_Load() in javascript function

Description:

In this example we explain that how to call Page_Load post back from JavaScript or how to call C# web Page_Load () in JavaScript function or raising post back using _doPostBack () function from JavaScript. Need to call Page_Load () method in JavaScript without clearing values in the pages. If we use JavaScript window.location.reload () then it will call page load () but clears all the value.so to overcome this problem here we create one hidden button in the web page and call its click event from the JavaScript so the page load will automatically call.

How can i get Selected file path in asp.net?

Description:

In this example we explain that how select folder path in asp.net using C# or how to get path of selected file in asp.net.how to browse file and get file path in asp.net.or how to get the full file path from asp: FileUplaod control. Or how can I get selected file path in asp.net.or how to get physical path or selected filed local path or drive path in asp.net.there are many question are raised for different user because we easily find the server path but to get the physical or local path its difficult because it will return fake path in JavaScript.

How to get the full file path from asp:FileUpload?

How can i get Selected file path in asp.net?

Description:

In this example we explain that how select folder path in asp.net using C# or how to get path of selected file in asp.net.how to browse file and get file path in asp.net.or how to get the full file path from asp: FileUplaod control. Or how can I get selected file path in asp.net.or how to get physical path or selected filed local path or drive path in asp.net.there are many question are raised for different user because we easily find the server path but to get the physical or local path its difficult because it will return fake path in JavaScript.

Monday, 24 October 2016

Select or Browse folder in asp.net



Description:

in this example we explain that how select folder in asp.net using C# or how to browse folder in asp.net.example to demonstrate how to browse folder in file upload control in asp.net.or select folder in input type=”file” in asp.net using C#.

there are many question are raised in our mind because by default file upload control allow user to select compulsory the file in file upload you cannot select folder or directory in file upload so below is the single line code to demonstrate how to select or browse folder in file upload control in asp.net. file dialog example in asp.net same like as in window form dialog.

<asp:FileUpload ID="FileUpload1"   runat="server" webkitdirectory />


webkitdirectory“ is the property that allow user to select or browse folder directly in file upload control in asp.net.

Select or Browse folder in asp.net

Select or Browse folder in asp.net



Description:

in this example we explain that how select folder in asp.net using C# or how to browse folder in asp.net.example to demonstrate how to browse folder in file upload control in asp.net.or select folder in input type=”file” in asp.net using C#.

there are many question are raised in our mind because by default file upload control allow user to select compulsory the file in file upload you cannot select folder or directory in file upload so below is the single line code to demonstrate how to select or browse folder in file upload control in asp.net. file dialog example in asp.net same like as in window form dialog.

<asp:FileUpload ID="FileUpload1"   runat="server" webkitdirectory />


webkitdirectory“ is the property that allow user to select or browse folder directly in file upload control in asp.net.

Friday, 21 October 2016

alertDialog and confirmDialog in CRM

Description:

In this example we explain that how to use alertDialog and confirmDialog to display messages to users In dynamic crm. Or how to display alert box or alert dialog box in CRM for tablets because simply javascript alert is not display for CRM tablets.so to display alert dialog or confirm dialog box or any messages to user in CRM tablets user you must have to use XRM alert dialog facility provided by XRM utility.

display alert and confirm dialog for Dynamic CRM tablets.

alertDialog and confirmDialog in CRM

Description:

In this example we explain that how to use alertDialog and confirmDialog to display messages to users In dynamic crm. Or how to display alert box or alert dialog box in CRM for tablets because simply javascript alert is not display for CRM tablets.so to display alert dialog or confirm dialog box or any messages to user in CRM tablets user you must have to use XRM alert dialog facility provided by XRM utility.
This entry was posted in :

Saturday, 15 October 2016


display notification in dynamic crm

Description:

In this example we explain that how to display Notification message in Dynamic CRM. before CRM 2013 if you want to alert to user only standard JavaScript alert is supported and in which user must be acknowledge in order for the user to continue.

So now days additional alert method was introduced in CRM 2013,this method allow user to specify three different types of alert like “error”,”Information” and “warning”.below the example of the set notification in CRM page.

Dynamics CRM Alert and Notification JavaScript Methods


display notification in dynamic crm

Description:

In this example we explain that how to display Notification message in Dynamic CRM. before CRM 2013 if you want to alert to user only standard JavaScript alert is supported and in which user must be acknowledge in order for the user to continue.

So now days additional alert method was introduced in CRM 2013,this method allow user to specify three different types of alert like “error”,”Information” and “warning”.below the example of the set notification in CRM page.
This entry was posted in :
call workflow from javascript or jQuery in dynamic crm


Description:

In this example we explain that how to call workflow from javascript or jQuery in dynamic crm.sometime we have requirement like we have to call the workflow based on some condition or some demand using javascript.how to find workflow from dynamic crm and call it form clientside like javascript and jQuery.

The user have to first find the workflowid,here we use callWorkFlow function for particular record asynchronously.optionally you can also add callback functions which will fire when the workflow has been executed sucessfully or if it fails.

Parameteres is WorkflowId/Guid,RecordID/Guid,Success Callback(function),Error Callback(function),CRM Base URL .

Call workflow from javascript or jQuery in Dynamic CRM

call workflow from javascript or jQuery in dynamic crm


Description:

In this example we explain that how to call workflow from javascript or jQuery in dynamic crm.sometime we have requirement like we have to call the workflow based on some condition or some demand using javascript.how to find workflow from dynamic crm and call it form clientside like javascript and jQuery.

The user have to first find the workflowid,here we use callWorkFlow function for particular record asynchronously.optionally you can also add callback functions which will fire when the workflow has been executed sucessfully or if it fails.

Parameteres is WorkflowId/Guid,RecordID/Guid,Success Callback(function),Error Callback(function),CRM Base URL .
This entry was posted in :

Friday, 14 October 2016

restrict duplicate primary key


Description:

in this example we explain that how to validate primary key in C# like suppose if user enter duplicate primary key then sqlException is raised or throw from ADO.Net so end user cannot understand the sql message proper so display proper sqlexception message to user then use the below code.

Here we use Try Catch block to capture this exception and display proper message to user.

Primary key validation in C#

restrict duplicate primary key


Description:

in this example we explain that how to validate primary key in C# like suppose if user enter duplicate primary key then sqlException is raised or throw from ADO.Net so end user cannot understand the sql message proper so display proper sqlexception message to user then use the below code.

Here we use Try Catch block to capture this exception and display proper message to user.
This entry was posted in :

Friday, 7 October 2016

Dynamically change the year of copyright in website



Description:

In this example we explain that how to dynamically change the copyright year in any website or any blog in asp.net. In every website or web application we define the copyright in footer section of the master page, generally we placed one of copyright in which year is mentioned like ©2015 All rights reserved. But it is fixed or static we cannot change after year is gone so when 2016 year is started then footer with copyright 2015 remain same.

Dynamically change the year of copyright in website in asp.net

Dynamically change the year of copyright in website



Description:

In this example we explain that how to dynamically change the copyright year in any website or any blog in asp.net. In every website or web application we define the copyright in footer section of the master page, generally we placed one of copyright in which year is mentioned like ©2015 All rights reserved. But it is fixed or static we cannot change after year is gone so when 2016 year is started then footer with copyright 2015 remain same.
Convert JSON Date to Standard Date Format in asp.net

Description:

In this example we explain that how to convert JSON date to normal date in asp.net or convert JSON return date to asp.net date and time format.

Many developers have a question like convert JSON date conversion into JavaScript code or JQuery
Code. Whenever you insert Date into Database using JSON format and when you retrieve that date from database it’s in JSON Format which is something like that:

Convert JSON Date to Standard Date Format in asp.net

Convert JSON Date to Standard Date Format in asp.net

Description:

In this example we explain that how to convert JSON date to normal date in asp.net or convert JSON return date to asp.net date and time format.

Many developers have a question like convert JSON date conversion into JavaScript code or JQuery
Code. Whenever you insert Date into Database using JSON format and when you retrieve that date from database it’s in JSON Format which is something like that:
Convert Rows to columns using 'Pivot' in SQL Server

Description:

In this example we explain that how to covert rows to column and column to rows in SQL Server.SQL Query to convert row data to column in SQL Server.sql query to display row data to column.or convert rows to columns using Pivot in SQL Server when columns are string data type.

Here we demonstrate switching rows and column in SQL Server. Or convert rows values into column value in SQL Server. Display row value in column value in SQL Server.

Convert Rows to columns using 'Pivot' in SQL Server

Convert Rows to columns using 'Pivot' in SQL Server

Description:

In this example we explain that how to covert rows to column and column to rows in SQL Server.SQL Query to convert row data to column in SQL Server.sql query to display row data to column.or convert rows to columns using Pivot in SQL Server when columns are string data type.

Here we demonstrate switching rows and column in SQL Server. Or convert rows values into column value in SQL Server. Display row value in column value in SQL Server.
This entry was posted in :

Thursday, 6 October 2016

Display the total sum of all Open Opportunities on the Dashboard

Description:

In this example we explain that how to display the total sum of all open opportunities on the dashboard. Or display the total sum of revenue of all opportunities in label format in dynamic crm. Or display the sum of the revenue of all opportunities in chart in dynamic crm.
Here we explain that how to customize the chart entity to display the sum of all opportunities In chart. Some question are raised in our mind like to display a total amount of opportunities in the pipeline on the dashboard like sum of the estimated costs for all opportunities.
So below is the code that demonstrate display sum of all opportunities in dashboard using customized the chart in dynamic crm.

display sum of revenue of opportunity in label in Dynamic CRM

Display the total sum of all Open Opportunities on the Dashboard

Description:

In this example we explain that how to display the total sum of all open opportunities on the dashboard. Or display the total sum of revenue of all opportunities in label format in dynamic crm. Or display the sum of the revenue of all opportunities in chart in dynamic crm.
Here we explain that how to customize the chart entity to display the sum of all opportunities In chart. Some question are raised in our mind like to display a total amount of opportunities in the pipeline on the dashboard like sum of the estimated costs for all opportunities.
So below is the code that demonstrate display sum of all opportunities in dashboard using customized the chart in dynamic crm.
This entry was posted in :

Sunday, 2 October 2016

send email crm

Description:

In this example we explain that how to send email on daily basis to sales team from Dynamic CRM.or how to sneding recurring reminder emails to sales team using tasks entity in dynamic crm.
Suppose your sales team wants to notified everyday for their scheduled calls of the day with help of the one email using dynamic crm.

So if we have need to send recurring emials to our customer or any sales team from dynamic crm.we can do it using the below steps:

Sending recurring reminder emails using Dynamic CRM

send email crm

Description:

In this example we explain that how to send email on daily basis to sales team from Dynamic CRM.or how to sneding recurring reminder emails to sales team using tasks entity in dynamic crm.
Suppose your sales team wants to notified everyday for their scheduled calls of the day with help of the one email using dynamic crm.

So if we have need to send recurring emials to our customer or any sales team from dynamic crm.we can do it using the below steps:
This entry was posted in :

Saturday, 1 October 2016

checked/unchecked all records in Gridview using javascript or jQuery.

Description:


In this example we explain that how to select and deselect all the record from gridview using javascript or jQuery.or how to checked or unchecked all the records in gridview using javascript.

In previous we already explain that how to delete multiple records form the gridview but here we use javascript to checked or unchecked all the records from gridview without any postback.


So how to select/deselect all checkbox in gridview in clientside using javascript or jQuery.below is the example to demostrate checked/unchecked all records from griview using javascript.

checked/unchecked all records in Gridview using javascript or jQuery.

checked/unchecked all records in Gridview using javascript or jQuery.

Description:


In this example we explain that how to select and deselect all the record from gridview using javascript or jQuery.or how to checked or unchecked all the records in gridview using javascript.

In previous we already explain that how to delete multiple records form the gridview but here we use javascript to checked or unchecked all the records from gridview without any postback.


So how to select/deselect all checkbox in gridview in clientside using javascript or jQuery.below is the example to demostrate checked/unchecked all records from griview using javascript.

Saturday, 24 September 2016

SQL TRIM() function

Description:

In this example we explain that how to TRIM the string in SQL Server or how to remove the white space in string in SQL Server.SQL Query to remove the white space character from string in SQL Server. fetch string with trimming the white space character form string in SQL Server.

Here we use TRIM() function of the SQL Server to remove the whitespace character.here we use LTRIM() and RTRIM() function of the SQL Server to remove left side and right side whitespace character from string.

SQL Query to remove whitespace character from string in SQL Server.

SQL TRIM() function

Description:

In this example we explain that how to TRIM the string in SQL Server or how to remove the white space in string in SQL Server.SQL Query to remove the white space character from string in SQL Server. fetch string with trimming the white space character form string in SQL Server.

Here we use TRIM() function of the SQL Server to remove the whitespace character.here we use LTRIM() and RTRIM() function of the SQL Server to remove left side and right side whitespace character from string.
This entry was posted in :
SQL REVERSE function

Description:

In this example we explain that how to Reverse the string in SQL Server or how to fetch string in reverse  order from SQL Server.SQL Query to reverse the string or fetch the string in reverse order from SQL Server.

Here we use REVERSE() function of the SQL Server it was introduced in SQL Server 2008.REVERSE() function will returns the string in reverse order of inputted by user.if you pass the non alphabet character(Integer) value then it will first convert it into string and then it will return in reverse order.

Reverse the String in SQL Server.

SQL REVERSE function

Description:

In this example we explain that how to Reverse the string in SQL Server or how to fetch string in reverse  order from SQL Server.SQL Query to reverse the string or fetch the string in reverse order from SQL Server.

Here we use REVERSE() function of the SQL Server it was introduced in SQL Server 2008.REVERSE() function will returns the string in reverse order of inputted by user.if you pass the non alphabet character(Integer) value then it will first convert it into string and then it will return in reverse order.

This entry was posted in :
SQL function to remove non numeric characters
Description:

In this example we explain that how to remove non numeric character from string in SQL Server.or fetch the string without non alphabet character or removing non numeric character from string using SQL Server function.

Here we create one SQL Server user defined function that will return string or text with removing non numeric character in SQL Server.here we simply input the value to SQL Server function and it will returns the string or value with removing non numeric character.

So below is the SQL Server user defined function that will remove non numeric characters from the given input value.

SQL function to remove non numeric characters

SQL function to remove non numeric characters
Description:

In this example we explain that how to remove non numeric character from string in SQL Server.or fetch the string without non alphabet character or removing non numeric character from string using SQL Server function.

Here we create one SQL Server user defined function that will return string or text with removing non numeric character in SQL Server.here we simply input the value to SQL Server function and it will returns the string or value with removing non numeric character.

So below is the SQL Server user defined function that will remove non numeric characters from the given input value.
This entry was posted in :
SQL function to remove non alphabet characters

Description:

In this example we explain that how to remove non alphabet character from string in SQL Server.or fetch the string without non alphabet character or removing non alphabet character from string using SQL Server function.

Here we create one SQL Server user defined function that will return string or text with removing non alphabet character in SQL Server.here we simply input the value to SQL Server function and it will returns the string or value with removing non alphabet character.

So below is the SQL Server user defined function that will remove non alphabet characters from the given input value.

SQL function to remove non alphabet characters

SQL function to remove non alphabet characters

Description:

In this example we explain that how to remove non alphabet character from string in SQL Server.or fetch the string without non alphabet character or removing non alphabet character from string using SQL Server function.

Here we create one SQL Server user defined function that will return string or text with removing non alphabet character in SQL Server.here we simply input the value to SQL Server function and it will returns the string or value with removing non alphabet character.

So below is the SQL Server user defined function that will remove non alphabet characters from the given input value.
This entry was posted in :

Sunday, 18 September 2016

Query to delete all stored procedures in SQL Server
Description:

In this example we explain that how to delete all stored procedure in SQL Server.or remove all the stored procedure from SQL Server.SQL Query to remove all the stored procedure from SQL Server.below is the SQL Query to remove or delete or drop the all the stored procedure in SQL Server.

Here we use cursor to fetch the stored procedure one by one from SQL Server and remove from the list.

SQL Query to delete all stored procedures in SQL Server

Query to delete all stored procedures in SQL Server
Description:

In this example we explain that how to delete all stored procedure in SQL Server.or remove all the stored procedure from SQL Server.SQL Query to remove all the stored procedure from SQL Server.below is the SQL Query to remove or delete or drop the all the stored procedure in SQL Server.

Here we use cursor to fetch the stored procedure one by one from SQL Server and remove from the list.
This entry was posted in :

Thursday, 15 September 2016

Get file name from file path in SQL

Description:


In this example we explain that how to Get file name from file full path in SQL Server.or hoe to fetch the file name from the SQL Server.as we know that we will store the full path of the file in SQL Server so how can I fetch the only file name from the SQL Server.below is the SQL Query that will fetch the file name from the full path in SQL Server.

The below query return the file name like “Customer.xlxs”

Get file name from file path in SQL

Get file name from file path in SQL

Description:


In this example we explain that how to Get file name from file full path in SQL Server.or hoe to fetch the file name from the SQL Server.as we know that we will store the full path of the file in SQL Server so how can I fetch the only file name from the SQL Server.below is the SQL Query that will fetch the file name from the full path in SQL Server.

The below query return the file name like “Customer.xlxs”
This entry was posted in :

Wednesday, 14 September 2016

Query to delete all view in SQL Server
Description:

In this example we explain that how to delete all views in SQL server or how to remove all View in SQL Server.below is the SQL Query to remove all the views form SQL Server.

Here we use the Cursor to loop each view one by one and drop or delete this view from SQL Server.

SQL Query to delete all view in SQL Server

Query to delete all view in SQL Server
Description:

In this example we explain that how to delete all views in SQL server or how to remove all View in SQL Server.below is the SQL Query to remove all the views form SQL Server.

Here we use the Cursor to loop each view one by one and drop or delete this view from SQL Server.
This entry was posted in :

Monday, 12 September 2016

 Check given date is weekend or not in sql
Description:

In this example we explain that how to find given date is weekend or not or check inputed date is weekend or not in SQLServer.SQL Query to check given date is weekend or not.

Here we demonstrate to check the date is weekend or not in SQL Server.some time in our application we must have scenario in which we have to disable the date or give proper message to user that given date or inputted date is weekend so please enter the another date.

Sometime also we have to find the report or generate report based on the weekend or any attendance report with weekend calculation at that time this below SQL query is very useful for us.

Check given date is weekend or not in sql

 Check given date is weekend or not in sql
Description:

In this example we explain that how to find given date is weekend or not or check inputed date is weekend or not in SQLServer.SQL Query to check given date is weekend or not.

Here we demonstrate to check the date is weekend or not in SQL Server.some time in our application we must have scenario in which we have to disable the date or give proper message to user that given date or inputted date is weekend so please enter the another date.

Sometime also we have to find the report or generate report based on the weekend or any attendance report with weekend calculation at that time this below SQL query is very useful for us.
This entry was posted in :

Saturday, 10 September 2016

SQL Query to reset the Identity
Description:

In this example we explain that how to reset the identity of table in SQL Server.or Reset identity seed after deleting records in SQL Server.or How to RESET identity column values in SQL Server. As we know that when we truncate the data ,table identity will be reset automatically but when we delete the records from the tables the identity will not be reset automatically so to reset identity of the column after perform delete operation in table in SQL Server below is the SQL Query to automatically reset the identity of the column.

SQL Query to reset the Identity

SQL Query to reset the Identity
Description:

In this example we explain that how to reset the identity of table in SQL Server.or Reset identity seed after deleting records in SQL Server.or How to RESET identity column values in SQL Server. As we know that when we truncate the data ,table identity will be reset automatically but when we delete the records from the tables the identity will not be reset automatically so to reset identity of the column after perform delete operation in table in SQL Server below is the SQL Query to automatically reset the identity of the column.
This entry was posted in :

Tuesday, 6 September 2016

JQuery Date Picker example to disable previous dates.

Description:

In this example we explain that how to disable previous dates in datepicker using jQuery.or how to disable previous date in Date picker in jQuery in asp.net.we all know that the basic requirement is that always disable the previous date in our web appliacation or disable minDate in date picker using jQuery in asp.net.

Here we use minDate property of the jQuery Date picker to  disable the previous date of the calender.

JQuery Date Picker example to disable previous dates.

JQuery Date Picker example to disable previous dates.

Description:

In this example we explain that how to disable previous dates in datepicker using jQuery.or how to disable previous date in Date picker in jQuery in asp.net.we all know that the basic requirement is that always disable the previous date in our web appliacation or disable minDate in date picker using jQuery in asp.net.

Here we use minDate property of the jQuery Date picker to  disable the previous date of the calender.

Saturday, 3 September 2016

Close jQuery UI Dialog Modal Popup when outside (Overlay Background) is clicked
Description:

In this example we explain that how to close jQuery Dialog Modal Popup when outside is clicked or how to hide the Modal popup when click on overlay Background.

How to close or hide modal popup in jQuery when click is perform outside the Modal popup. Here the background is in overlay mode or in invisible mode so when click on any part of the body the modal popup will be automatically close or hide regardless of the click on the close button.

Close jQuery UI Dialog Modal Popup when outside (Overlay Background) is clicked

Close jQuery UI Dialog Modal Popup when outside (Overlay Background) is clicked
Description:

In this example we explain that how to close jQuery Dialog Modal Popup when outside is clicked or how to hide the Modal popup when click on overlay Background.

How to close or hide modal popup in jQuery when click is perform outside the Modal popup. Here the background is in overlay mode or in invisible mode so when click on any part of the body the modal popup will be automatically close or hide regardless of the click on the close button.
jQuery UI Dialog Modal Popup Yes No Confirm example in ASP.Net
Description:

In this example we explain that how to display jQuery UI Dialog Modal Popup with YES NO Confirm button in asp.net.here we use jQuery UI Dialog popup to display popup to user with YES,NO and confirm popup to perform the Delete operation in asp.net.

Here we demonstrate jQuery UI Dialog Popup example with yes no and confirm button in asp.net to perform the any operation with confirmation by user.

Here we have a button and if click on delete button then popup will asked user for the confirmation with YES NO option and perform the operation as per option click by user.
Generally we used that types of dialog box in any delete operation.

confirmation box with yes/no button options using modalpopup in asp.net.

jQuery UI Dialog Modal Popup Yes No Confirm example in ASP.Net
Description:

In this example we explain that how to display jQuery UI Dialog Modal Popup with YES NO Confirm button in asp.net.here we use jQuery UI Dialog popup to display popup to user with YES,NO and confirm popup to perform the Delete operation in asp.net.

Here we demonstrate jQuery UI Dialog Popup example with yes no and confirm button in asp.net to perform the any operation with confirmation by user.

Here we have a button and if click on delete button then popup will asked user for the confirmation with YES NO option and perform the operation as per option click by user.
Generally we used that types of dialog box in any delete operation.
Display animated GIF image before iframe content is loaded
Description:

In this example we explain that Display animated GIF image before iframe content is loaded .or display gif image before iframe content is not loaded.

Suppose if you are working with iframe then iframe content take time to load,so if you may want to display a simple gif loading image that indicate the end user that loading process is working so wait for some time.

Show a loading gif while iframe page content loads using jQuery.

Display animated GIF image before iframe content is loaded
Description:

In this example we explain that Display animated GIF image before iframe content is loaded .or display gif image before iframe content is not loaded.

Suppose if you are working with iframe then iframe content take time to load,so if you may want to display a simple gif loading image that indicate the end user that loading process is working so wait for some time.

Sunday, 21 August 2016

Auto Complete Search TextBox in MasterPage using JQuery and WebServices in Asp.Net using C#
Description:

In this example we explain that how to implement auto suggestion search textbox or auto complete textbox in master page in asp.net. Or auto complete textbox in asp.net master page using jQuery with web service.

Simply we already explain that how to autocomplete textbox or auto suggestion in textbox in asp.net but here we use master page with jQuery web service.so how to implement jQuery autocomplete in master page with its content page using web service in jQuery.

Auto Complete Search TextBox in MasterPage using JQuery and WebServices in Asp.Net using C#

Auto Complete Search TextBox in MasterPage using JQuery and WebServices in Asp.Net using C#
Description:

In this example we explain that how to implement auto suggestion search textbox or auto complete textbox in master page in asp.net. Or auto complete textbox in asp.net master page using jQuery with web service.

Simply we already explain that how to autocomplete textbox or auto suggestion in textbox in asp.net but here we use master page with jQuery web service.so how to implement jQuery autocomplete in master page with its content page using web service in jQuery.

Thursday, 18 August 2016

Import (Upload) CSV file data to SQL Server DataBase in ASP.Net using C#
Description:

In this example we explain that how to upload CSV file data to SQL Server database in asp.net application using C#.

Or how to Import CSV file data to SQL Server database in asp.net.generally we read the CSV file Data and inserted it into SQL Server Database. Sometimes we have requirement like we have thousands of record are available in CSV file so it is very time consuming if we inserted it manually to the Database by application so to overcome his we develop the code in which you have to just upload the CSV format file and it will automatically read the data (records) by separating delimiter and inserting it in SQL Server database.

Here we also use the SQLBulkCopy class to insert the data.

Import (Upload) CSV file data to SQL Server DataBase in ASP.Net using C#

Import (Upload) CSV file data to SQL Server DataBase in ASP.Net using C#
Description:

In this example we explain that how to upload CSV file data to SQL Server database in asp.net application using C#.

Or how to Import CSV file data to SQL Server database in asp.net.generally we read the CSV file Data and inserted it into SQL Server Database. Sometimes we have requirement like we have thousands of record are available in CSV file so it is very time consuming if we inserted it manually to the Database by application so to overcome his we develop the code in which you have to just upload the CSV format file and it will automatically read the data (records) by separating delimiter and inserting it in SQL Server database.

Here we also use the SQLBulkCopy class to insert the data.

Wednesday, 17 August 2016

Get and Set Selected Text and Value of RadioButtonList using jQuery in ASP.Net
Description:

In this example we explain that how to Get or set the Text /value of the RadioButtonList using JavaScript and jQuery in asp.net.or get or set the selected Text and Value pair of the radioButtonList using JavaScript or jQuery.

Here below is the example of list of the Game defines with RadioButtonList and when you click on submit button it will display the alert message with the selected Text and value of the radioButtonList using client side JavaScript and jQuery.

Get and Set Selected Text and Value of RadioButtonList using JavaScript or jQuery in ASP.Net

Get and Set Selected Text and Value of RadioButtonList using jQuery in ASP.Net
Description:

In this example we explain that how to Get or set the Text /value of the RadioButtonList using JavaScript and jQuery in asp.net.or get or set the selected Text and Value pair of the radioButtonList using JavaScript or jQuery.

Here below is the example of list of the Game defines with RadioButtonList and when you click on submit button it will display the alert message with the selected Text and value of the radioButtonList using client side JavaScript and jQuery.
Save (Insert) RadioButton value to SQL Server Database in ASP.Net using C#
Description:

in this example we explain that how to Save or Insert RadioButton value to Database in asp.net using C#.or how to insert RadiButton value into SQL Server database using C#.

as we know that generally we store the  RadioButton  value instead of text.because the text may be the changed so in future you have to just changed in design side not in backed or in SQL Server.
So how to access the value of RadioButton and save it into SQL Server Database.

Below is the example that demonstrate the store the Gender value in database.

Save (Insert) RadioButton value to SQL Server Database in ASP.Net using C#

Save (Insert) RadioButton value to SQL Server Database in ASP.Net using C#
Description:

in this example we explain that how to Save or Insert RadioButton value to Database in asp.net using C#.or how to insert RadiButton value into SQL Server database using C#.

as we know that generally we store the  RadioButton  value instead of text.because the text may be the changed so in future you have to just changed in design side not in backed or in SQL Server.
So how to access the value of RadioButton and save it into SQL Server Database.

Below is the example that demonstrate the store the Gender value in database.

Show Hide DIV with TextBox based on RadioButton selection (checked unchecked) using JavaScript and jQuery

Show Hide DIV with TextBox based on RadioButton selection (checked unchecked) using JavaScript and jQuery
Description:

In this example we explain that how to show or hide DIV or panel with Textbox and grouping of control based on RadioButton selection using JavaScript/jQuery in asp.net.

We all know that that’s type of requirement are daily work for the any software development like for example if we have two RadioButton like “self” and “other” in job application form in which if user selected or checked “other” RadioButton” then and then only show the below TextBox with DIV element.so how can you have implement.

There are many scenario in which that types of show or hide group of control based on RadioButton selection (checked/unchecked).

So here we explain that how to show hide DIV when RadionButton selection is changed.
Below is the JavaScript and jQuery to demonstrate the show or hide DIV or group of control based on RadioButton selection.

Show Hide DIV with TextBox based on RadioButton selection using JavaScript or jQuery

Show Hide DIV with TextBox based on RadioButton selection (checked unchecked) using JavaScript and jQuery

Show Hide DIV with TextBox based on RadioButton selection (checked unchecked) using JavaScript and jQuery
Description:

In this example we explain that how to show or hide DIV or panel with Textbox and grouping of control based on RadioButton selection using JavaScript/jQuery in asp.net.

We all know that that’s type of requirement are daily work for the any software development like for example if we have two RadioButton like “self” and “other” in job application form in which if user selected or checked “other” RadioButton” then and then only show the below TextBox with DIV element.so how can you have implement.

There are many scenario in which that types of show or hide group of control based on RadioButton selection (checked/unchecked).

So here we explain that how to show hide DIV when RadionButton selection is changed.
Below is the JavaScript and jQuery to demonstrate the show or hide DIV or group of control based on RadioButton selection.

Thursday, 21 July 2016

how to get disabled TextBox value in c#

how to get disabled TextBox value in c#

how to get disabled TextBox value in c#
Description:

In this example we explain that how to fetch value of disabled textbox in asp.net.or how to retrieving value of disabled Asp.Net textbox. Or how to get disabled textbox value in C#.

.net cannot get value from disabled or read-only textbox control so how to get new updated value of disabled textbox in asp.net in code behind.

For example suppose I have 3 textbox price, quantity and total. The value of the total textbox is disabled because of the total is automatically calculated based on the quantity and price.so when we update the quantity or price the total will be calculated proper but when we click on save button it will retrieve or fetch always its old or previous values because of the textbox disabled.so to overcome this problem we have to add one more HiddenField that will store the updated value of the disabled textbox(total textbox value) and when user click on save button at that time we have to insert HiddenField value so it will always save the latest or updated value of the disabled textbox.

how to get disabled TextBox value in c#

how to get disabled TextBox value in c#

how to get disabled TextBox value in c#

how to get disabled TextBox value in c#
Description:

In this example we explain that how to fetch value of disabled textbox in asp.net.or how to retrieving value of disabled Asp.Net textbox. Or how to get disabled textbox value in C#.

.net cannot get value from disabled or read-only textbox control so how to get new updated value of disabled textbox in asp.net in code behind.

For example suppose I have 3 textbox price, quantity and total. The value of the total textbox is disabled because of the total is automatically calculated based on the quantity and price.so when we update the quantity or price the total will be calculated proper but when we click on save button it will retrieve or fetch always its old or previous values because of the textbox disabled.so to overcome this problem we have to add one more HiddenField that will store the updated value of the disabled textbox(total textbox value) and when user click on save button at that time we have to insert HiddenField value so it will always save the latest or updated value of the disabled textbox.

Wednesday, 20 July 2016

swapping data

Description:

In this example we explain that how to Swap values between two columns using SQL Server query. Or how to update column1 values to column2 and column2 values to column1 like vice versa in sql server using update statement.

As we all know that when we working with database moving, swapping and updating values between a column is a common task for the all the developer in IT industries because there is a routine work.
Here in the below example we have one table called test in which there are two column column1 and column2 in which we have to swap the data column1 to column2 and vice versa.

How to Swap Values between Two Columns in SQL Server

swapping data

Description:

In this example we explain that how to Swap values between two columns using SQL Server query. Or how to update column1 values to column2 and column2 values to column1 like vice versa in sql server using update statement.

As we all know that when we working with database moving, swapping and updating values between a column is a common task for the all the developer in IT industries because there is a routine work.
Here in the below example we have one table called test in which there are two column column1 and column2 in which we have to swap the data column1 to column2 and vice versa.
This entry was posted in :
 how to access shared Network drive file using C#
Description:

In this example we explain that how to access shared Network drive file using C# code. Or how to access file from remote computer with providing credential or how to access server file that is hosted on another network with same domain. Or how to access file on another computer shared folder. Or access network file using asap.net.or how to provide user name and password when connecting to a network share in asp.net.

There are many question that how to use network file that is located in another computer. Below is the code that demonstrate that how to use the network file with login with credential in remote computer. First you have to create a NetworkShareAccesser class to validate the user with credential.

How to access shared Network drive file using C#

 how to access shared Network drive file using C#
Description:

In this example we explain that how to access shared Network drive file using C# code. Or how to access file from remote computer with providing credential or how to access server file that is hosted on another network with same domain. Or how to access file on another computer shared folder. Or access network file using asap.net.or how to provide user name and password when connecting to a network share in asp.net.

There are many question that how to use network file that is located in another computer. Below is the code that demonstrate that how to use the network file with login with credential in remote computer. First you have to create a NetworkShareAccesser class to validate the user with credential.

Monday, 18 July 2016

Add Row Click event to GridView Rows in ASP.Net

Add Row Click event to GridView Rows in ASP.Net
Description:

In this example we explain that how to add Row Click event in GridView in asp.net using C#.or how to add row click event to Gridview Rows in asp.net.

Sometime we have requirement like when user click on Gridview Row then it will display its related information on popup.

Here we demonstrate how to pass row index in the row click of the gridview and perform some operation.we used gridviews onSelectedIndexChanged event to perform the row click functionality of the gridview.

How to add click event to rows in Gridview in asp.net

Add Row Click event to GridView Rows in ASP.Net

Add Row Click event to GridView Rows in ASP.Net
Description:

In this example we explain that how to add Row Click event in GridView in asp.net using C#.or how to add row click event to Gridview Rows in asp.net.

Sometime we have requirement like when user click on Gridview Row then it will display its related information on popup.

Here we demonstrate how to pass row index in the row click of the gridview and perform some operation.we used gridviews onSelectedIndexChanged event to perform the row click functionality of the gridview.

Friday, 15 July 2016

scroll to first error


Description:

In this example we explain that how to set cursor to first error when validation raise error in asp.net.or scroll to the first error when error is raised in asp.net.

We all know that for the user point of view if our application have a long form at that time user will fill up the form and then last when he/she click on the submit button and if the validation is fired at that time user doesn’t have any idea which filled are missing or incorrect because of the long form.
So avoid this type of mistake and provide nice layout to the user for the end user satisfaction we have to direct scroll user to the first error raised by the validator so user can easily understand that and solved that.

So below is the code that demonstrate how to scroll to first validator error when validation failed in asp.net.

set cursor to first error when validation raise error in asp.net

scroll to first error


Description:

In this example we explain that how to set cursor to first error when validation raise error in asp.net.or scroll to the first error when error is raised in asp.net.

We all know that for the user point of view if our application have a long form at that time user will fill up the form and then last when he/she click on the submit button and if the validation is fired at that time user doesn’t have any idea which filled are missing or incorrect because of the long form.
So avoid this type of mistake and provide nice layout to the user for the end user satisfaction we have to direct scroll user to the first error raised by the validator so user can easily understand that and solved that.

So below is the code that demonstrate how to scroll to first validator error when validation failed in asp.net.
refresh a Grid View automatically at regular intervals
Description:

In this example we explain that how to refresh a Grid View automatically at regular intervals in asp.net.or refresh grid view after every 5 second in asp.net using C#.

Here we use we use Timer control to achieve this requirements. Simply we add the Grid view in the AJAX Update Panel control and set the timer interval in which we have to refresh the grid view automatically.

Below the code that demonstrate auto refresh grid view after specified interval in asp.net.

Auto Refresh Update GridView In Asp.Net Ajax With Timer.

refresh a Grid View automatically at regular intervals
Description:

In this example we explain that how to refresh a Grid View automatically at regular intervals in asp.net.or refresh grid view after every 5 second in asp.net using C#.

Here we use we use Timer control to achieve this requirements. Simply we add the Grid view in the AJAX Update Panel control and set the timer interval in which we have to refresh the grid view automatically.

Below the code that demonstrate auto refresh grid view after specified interval in asp.net.

Thursday, 14 July 2016

Server Side (Code Behind) Yes No Confirmation Message Box in ASP.Net

Description:

In this example we explain that how to display Confirmation box in server side in asp.net. Or display confirm box in code behind in c# in asp.net.or how to build a confirm message or dialog box at server side or code behind in asp.net.

In client side using JavaScript it is possible to create confirm box simply but how can I call on server side because JavaScript only post back when we click on “OK” but when we click on “Cancel” it will not post back. So how can I perform operation when click on OK or Cancel as per click.

Below is the example that demonstrate display confirm box when click on button and display message to the user you press ok button or cancel button at server side or code behind in asp.net.

display confirmbox code behind (server side) in asp.net

Server Side (Code Behind) Yes No Confirmation Message Box in ASP.Net

Description:

In this example we explain that how to display Confirmation box in server side in asp.net. Or display confirm box in code behind in c# in asp.net.or how to build a confirm message or dialog box at server side or code behind in asp.net.

In client side using JavaScript it is possible to create confirm box simply but how can I call on server side because JavaScript only post back when we click on “OK” but when we click on “Cancel” it will not post back. So how can I perform operation when click on OK or Cancel as per click.

Below is the example that demonstrate display confirm box when click on button and display message to the user you press ok button or cancel button at server side or code behind in asp.net.

Tuesday, 12 July 2016

group by with alias column name in SQL Server
Description:

In this example we explain that how to group by with alias column name in SQL Server query. Or group by on alias column in SQL Server. Or SQL Server example to Group by alias column name in SQL query.

Sometime we have requirement like required or fetch data in SQL Server but in alias column name. Below is the query that demonstrates the Group by data in SQL Server with alias column name.

SQL Server query to group by with alias column name .

group by with alias column name in SQL Server
Description:

In this example we explain that how to group by with alias column name in SQL Server query. Or group by on alias column in SQL Server. Or SQL Server example to Group by alias column name in SQL query.

Sometime we have requirement like required or fetch data in SQL Server but in alias column name. Below is the query that demonstrates the Group by data in SQL Server with alias column name.
This entry was posted in :

Thursday, 7 July 2016

Query to find all stored procedure containing <text>? In SQL Server
Description:

In this example we explain that how to find all Stored Procedure containing text. Or how do I find a stored procedure procedure contain a text. Search text in a stored procedure in SQL Server. Search string in a stored procedure. Find all procedure in SQL Server that contains a specified text. Find stored procedure by a string.

There are lots of question are arise in our mind when we would not know that how many procedure are used like we search.

Suppose we have requirement like find all the stored procedure in SQL Database which contain a particular text that may be a field name or any declare variable name or anything.

How do I find all stored procedure containing ? In SQL Server

Query to find all stored procedure containing <text>? In SQL Server
Description:

In this example we explain that how to find all Stored Procedure containing text. Or how do I find a stored procedure procedure contain a text. Search text in a stored procedure in SQL Server. Search string in a stored procedure. Find all procedure in SQL Server that contains a specified text. Find stored procedure by a string.

There are lots of question are arise in our mind when we would not know that how many procedure are used like we search.

Suppose we have requirement like find all the stored procedure in SQL Database which contain a particular text that may be a field name or any declare variable name or anything.

This entry was posted in :

Wednesday, 6 July 2016

JSON support in SQL Server 2016
Description:

In this example we explain that how to use JSON in SQL Server 2016.or how to use JSON in SQL Server or retrieve or fetch data from SQL Server in JSON format.

Till now it was tricky in sql to split or use Json , But SQL Server 2016 has provided Inbuilt functions for JSON support.

How to retrieve data from SQL Sever in JSON format.

JSON support in SQL Server 2016
Description:

In this example we explain that how to use JSON in SQL Server 2016.or how to use JSON in SQL Server or retrieve or fetch data from SQL Server in JSON format.

Till now it was tricky in sql to split or use Json , But SQL Server 2016 has provided Inbuilt functions for JSON support.

How to integrate citrus payment gateway in ASP.NET



Description:
  • generally online payment gateway flow as follows.
    • When customers are ready to pay, they enter their payment information and click the payment button on your website.
    • The payment gateway encrypts data and securely sends it through the payment processing network.
    • The transaction is reviewed for authorization or decline, and the results are sent back through the Payflow payment gateway.
    • Your customer receives a confirmation receipt and you fulfill the order.
    • Once the transaction is processed, funds are transferred from the customer’s bank account to your merchant bank account.



So now, how to integrate onsite citrus payment integration in asp.net with c#.
Pre requisites : 
    • Citrus Account
    • Vanity Url
    • ​Security creadentials 
​Login to sandbox (in case of Testing) or production (in case of Live) using the user ID and password received from Citruspay.

How to Get Vanity URL :

 After login to your citrus account and go to checkout page setting tab in right panel.


How to Get Security Credentials :




Payment Request Parameters : 

  Before go further please make sure your payment paramters as per below discription.



1. Create a sample request page to post a transaction request to citrus. (Refer PaymentRedirect.aspx Page.)
2. Create a sample response page to receive the response on your website.(Refer PaymentRespose.aspx page)

Once user click on Make payment button redirect them to ​PaymentRedirect.aspx with your session variables.

Create a sample request page to post a transaction request to citrus.
Page: PaymentRedirect.aspx

PaymentRedirect.aspx:
​​
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PaymentRedirect.aspx.cs"
    Inherits="PaymentRedirect" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Payment Redirect</title>   
    <script type="text/javascript">
        function myfunc() {
            var frm = document.all("formpayment");
            frm.submit();
        }
        window.onload = myfunc;
    </script>
</head>
<body>   
    <table class="divWaiting" width="100%">
        <tr>
            <td height="200px">
                 
            </td>
        </tr>
        <tr>
            <td align="center">
                <img alt="Processing" src="Images/updateprogress.gif" />
            </td>
        </tr>
        <tr>
            <td align="center"
                   style="color: black; font-family: Calibri; font-size: 22px;">
                Please wait while we are redirect you to payment gateway for precessing...
                <br />
                Please do not press <strong>Stop</strong>,
                   <strong>Back</strong> or <strong>Refresh</strong>
                button or <strong>Close</strong> this window."
            </td>
        </tr>
    </table>
    <form id="formpayment" method="post" action="<%=formPostUrl%>">
    <input type="hidden" id="merchantTxnId" name="merchantTxnId" value="<%=merchantTxnId%>" />
    <input type="hidden" id="orderAmount" name="orderAmount" value="<%=orderAmount%>" />
    <input type="hidden" id="currency" name="currency" value="<%=currency%>" />
    <input type="hidden" name="returnUrl" value="<%=returnUrl %>" />
    <input type="hidden" id="notifyUrl" name="notifyUrl" value="<%=notifyUrl%>" />
    <input type="hidden" id="secSignature" name="secSignature" value="<%=securitySignature%>" />
    </form>
</body>
</html>


​​​

PaymentRedirect.aspx.cs :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Net;
using System.Text;
using System.IO;


public partial class PaymentRedirect : System.Web.UI.Page
{
    LogErrorToLogFile logFile = new LogErrorToLogFile();

    protected string formPostUrl = "";
    protected string currency = "";
    protected string returnUrl = "";
    protected string notifyUrl = "";

    protected string merchantTxnId = "";
    protected string secret_key = "";
    protected string vanityUrl = "";
    protected string orderAmount = "0.00";
    protected string securitySignature = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
       //Get All Payment Related Details from Database server. or set details in
         web.config file.
            DataTable dtPaymentInformation = null;
            DevCommon.Select("SPSelectApplicationPaymentDetailByApplicationFormId",
        ref dtPaymentInformation, Convert.ToInt64(Session["ApplicationFormId"]));
            if (dtPaymentInformation != null && dtPaymentInformation.Rows.Count > 0)
            {
    
            currency = Convert.ToString(dtPaymentInformation.Rows[0]["currency"]);
            returnUrl = Convert.ToString(dtPaymentInformation.Rows[0]["returnUrl"]);
            notifyUrl = Convert.ToString(dtPaymentInformation.Rows[0]["notifyUrl"]);
           // Will provide unique for every request to citrus.    
            merchantTxnId = Convert.ToString(Session["TransactionReferenceNo"]); 
           
            secret_key = Convert.ToString(dtPaymentInformation.Rows[0]["secret_key"]);
            vanityUrl = Convert.ToString(dtPaymentInformation.Rows[0]["vanityUrl"]);
            formPostUrl = "https://www.citruspay.com/" + vanityUrl;
                
            orderAmount = Convert.ToString(dtPaymentInformation.Rows[0]["AdminCharges"]);
       // For testing we have set order amount 1 rupees.
            orderAmount = "1";
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
            string data = vanityUrl + orderAmount + merchantTxnId + currency;

            System.Security.Cryptography.HMACSHA1 myhmacsha1 = new
       System.Security.Cryptography.HMACSHA1(Encoding.ASCII.GetBytes(secret_key));
            System.IO.MemoryStream stream = new
       System.IO.MemoryStream(Encoding.ASCII.GetBytes(data));
            securitySignature =
       BitConverter.ToString(myhmacsha1.ComputeHash(stream)).Replace("-", "").ToLower();

        }
        catch (Exception ex)
        {
            logFile.LogError(ex);
            return;
        }
    }
}
​​

Create a sample response page to receive the response on your website.

Create Page PaymentRespose.aspx and paste below code in .cs file.

PaymentRespose.aspx.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;

public partial class PaymentResponse : System.Web.UI.Page
{
    LogErrorToLogFile logFile = new LogErrorToLogFile();
    string txnId = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string data = "";
            txnId = Request["TxId"];
            string TxRefNo = Request["TxRefNo"];
            string txnStatus = Request["TxStatus"];
            string amount = Request["amount"];
            string TxMsg = Request["TxMsg"];           
            string pgTxnId = Request["pgTxnNo"];
            string issuerRefNo = Request["issuerRefNo"];
            string authIdCode = Request["authIdCode"];
            string firstName = Request["firstName"];
            string lastName = Request["lastName"];
            string pgRespCode = Request["pgRespCode"];
            string zipCode = Request["addressZip"];
            string resSignature = Request["signature"];
       
            bool flag = true;
            if (txnId != null)
            {
                data += txnId;
            }
            if (txnStatus != null)
            {
                data += txnStatus;
            }
            if (amount != null)
            {
                data += amount;
            }
            if (pgTxnId != null)
            {
                data += pgTxnId;
            }
            if (issuerRefNo != null)
            {
                data += issuerRefNo;
            }
            if (authIdCode != null)
            {
                data += authIdCode;
            }
            if (firstName != null)
            {
                data += firstName;
            }
            if (lastName != null)
            {
                data += lastName;
            }
            if (pgRespCode != null)
            {
                data += pgRespCode;
            }
            if (zipCode != null)
            {
                data += zipCode;
            }
      
            // Get a secret key from web.config or database server.
            //string secret_key = ConfigurationManager.AppSettings["secret_key"].ToString();

            DataTable dtPaymentInfo = null;
            string secret_key = "";
            DevCommon.Select("SPSelectApplicationPaymentDetailByTxId",
       ref dtPaymentInfo, Convert.ToString(txnId));
            if (dtPaymentInfo != null && dtPaymentInfo.Rows.Count > 0)
            {
                secret_key = Convert.ToString(dtPaymentInfo.Rows[0]["secret_key"]);
            }
            System.Security.Cryptography.HMACSHA1 myhmacsha1 = new
       System.Security.Cryptography.HMACSHA1(
            System.Text.Encoding.ASCII.GetBytes(secret_key));
            System.IO.MemoryStream stream = new
            System.IO.MemoryStream(System.Text.Encoding.ASCII.GetBytes(data));
            string signature =
       BitConverter.ToString(myhmacsha1.ComputeHash(stream)).Replace("-", "").ToLower();

            if (resSignature != null && !signature.Equals(resSignature))
            {
                flag = false;
            }

            if (flag)
            {
                DataTable datatable = null;
                object[] objPara = new object[14];
                objPara[0] = Convert.ToInt32(Session["ApplicationFormId"]);
                objPara[1] = txnId;
                objPara[2] = TxRefNo;
                objPara[3] = txnStatus;
                objPara[4] = amount;
                objPara[5] = TxMsg;
                objPara[6] = pgTxnId;
                objPara[7] = issuerRefNo;
                objPara[8] = authIdCode;
                objPara[9] = firstName;
                objPara[10] = lastName;
                objPara[11] = pgRespCode;
                objPara[12] = zipCode;
                objPara[13] = signature;
           

                   // Update transaction status in database and make sure your database
                   //amount and tansaction amount both are same while update transaction
                //status(eg. SUCCESS).
                DevCommon.InsertUpdate("SPUpdatePaymentDetails", ref datatable, objPara);
                if (datatable != null && datatable.Rows.Count > 0 &&
                   Convert.ToInt64(datatable.Rows[0][0]) > 0)
                {
                      // after successful update redirect to payment receipt for payment details.
                   //create payment reciept page as your requirement.
                    Response.Redirect("PaymentReceipt.aspx?txnId=" +
                       EncryptDecrypt.Encrypt(Convert.ToString(txnId), "P@ssw0rd"),false);
                }
            }
            else
            {
                Response.Redirect("default.aspx");
            }
        }
        catch (Exception ex)
        {
            // mail to Admin if fail to update status in database and redirect
       // to another page.           
            Response.Redirect("default.aspx");
        }

    }
}





How to integrate citrus payment gateway in ASP.NET


How to integrate citrus payment gateway in ASP.NET



Description:
  • generally online payment gateway flow as follows.
    • When customers are ready to pay, they enter their payment information and click the payment button on your website.
    • The payment gateway encrypts data and securely sends it through the payment processing network.
    • The transaction is reviewed for authorization or decline, and the results are sent back through the Payflow payment gateway.
    • Your customer receives a confirmation receipt and you fulfill the order.
    • Once the transaction is processed, funds are transferred from the customer’s bank account to your merchant bank account.



So now, how to integrate onsite citrus payment integration in asp.net with c#.
Pre requisites : 
    • Citrus Account
    • Vanity Url
    • ​Security creadentials 
​Login to sandbox (in case of Testing) or production (in case of Live) using the user ID and password received from Citruspay.

How to Get Vanity URL :

 After login to your citrus account and go to checkout page setting tab in right panel.


How to Get Security Credentials :




Payment Request Parameters : 

  Before go further please make sure your payment paramters as per below discription.



1. Create a sample request page to post a transaction request to citrus. (Refer PaymentRedirect.aspx Page.)
2. Create a sample response page to receive the response on your website.(Refer PaymentRespose.aspx page)

Once user click on Make payment button redirect them to ​PaymentRedirect.aspx with your session variables.

Create a sample request page to post a transaction request to citrus.
Page: PaymentRedirect.aspx

PaymentRedirect.aspx:
​​
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PaymentRedirect.aspx.cs"
    Inherits="PaymentRedirect" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Payment Redirect</title>   
    <script type="text/javascript">
        function myfunc() {
            var frm = document.all("formpayment");
            frm.submit();
        }
        window.onload = myfunc;
    </script>
</head>
<body>   
    <table class="divWaiting" width="100%">
        <tr>
            <td height="200px">
                 
            </td>
        </tr>
        <tr>
            <td align="center">
                <img alt="Processing" src="Images/updateprogress.gif" />
            </td>
        </tr>
        <tr>
            <td align="center"
                   style="color: black; font-family: Calibri; font-size: 22px;">
                Please wait while we are redirect you to payment gateway for precessing...
                <br />
                Please do not press <strong>Stop</strong>,
                   <strong>Back</strong> or <strong>Refresh</strong>
                button or <strong>Close</strong> this window."
            </td>
        </tr>
    </table>
    <form id="formpayment" method="post" action="<%=formPostUrl%>">
    <input type="hidden" id="merchantTxnId" name="merchantTxnId" value="<%=merchantTxnId%>" />
    <input type="hidden" id="orderAmount" name="orderAmount" value="<%=orderAmount%>" />
    <input type="hidden" id="currency" name="currency" value="<%=currency%>" />
    <input type="hidden" name="returnUrl" value="<%=returnUrl %>" />
    <input type="hidden" id="notifyUrl" name="notifyUrl" value="<%=notifyUrl%>" />
    <input type="hidden" id="secSignature" name="secSignature" value="<%=securitySignature%>" />
    </form>
</body>
</html>


​​​

PaymentRedirect.aspx.cs :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Net;
using System.Text;
using System.IO;


public partial class PaymentRedirect : System.Web.UI.Page
{
    LogErrorToLogFile logFile = new LogErrorToLogFile();

    protected string formPostUrl = "";
    protected string currency = "";
    protected string returnUrl = "";
    protected string notifyUrl = "";

    protected string merchantTxnId = "";
    protected string secret_key = "";
    protected string vanityUrl = "";
    protected string orderAmount = "0.00";
    protected string securitySignature = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
       //Get All Payment Related Details from Database server. or set details in
         web.config file.
            DataTable dtPaymentInformation = null;
            DevCommon.Select("SPSelectApplicationPaymentDetailByApplicationFormId",
        ref dtPaymentInformation, Convert.ToInt64(Session["ApplicationFormId"]));
            if (dtPaymentInformation != null && dtPaymentInformation.Rows.Count > 0)
            {
    
            currency = Convert.ToString(dtPaymentInformation.Rows[0]["currency"]);
            returnUrl = Convert.ToString(dtPaymentInformation.Rows[0]["returnUrl"]);
            notifyUrl = Convert.ToString(dtPaymentInformation.Rows[0]["notifyUrl"]);
           // Will provide unique for every request to citrus.    
            merchantTxnId = Convert.ToString(Session["TransactionReferenceNo"]); 
           
            secret_key = Convert.ToString(dtPaymentInformation.Rows[0]["secret_key"]);
            vanityUrl = Convert.ToString(dtPaymentInformation.Rows[0]["vanityUrl"]);
            formPostUrl = "https://www.citruspay.com/" + vanityUrl;
                
            orderAmount = Convert.ToString(dtPaymentInformation.Rows[0]["AdminCharges"]);
       // For testing we have set order amount 1 rupees.
            orderAmount = "1";
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
            string data = vanityUrl + orderAmount + merchantTxnId + currency;

            System.Security.Cryptography.HMACSHA1 myhmacsha1 = new
       System.Security.Cryptography.HMACSHA1(Encoding.ASCII.GetBytes(secret_key));
            System.IO.MemoryStream stream = new
       System.IO.MemoryStream(Encoding.ASCII.GetBytes(data));
            securitySignature =
       BitConverter.ToString(myhmacsha1.ComputeHash(stream)).Replace("-", "").ToLower();

        }
        catch (Exception ex)
        {
            logFile.LogError(ex);
            return;
        }
    }
}
​​

Create a sample response page to receive the response on your website.

Create Page PaymentRespose.aspx and paste below code in .cs file.

PaymentRespose.aspx.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;

public partial class PaymentResponse : System.Web.UI.Page
{
    LogErrorToLogFile logFile = new LogErrorToLogFile();
    string txnId = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string data = "";
            txnId = Request["TxId"];
            string TxRefNo = Request["TxRefNo"];
            string txnStatus = Request["TxStatus"];
            string amount = Request["amount"];
            string TxMsg = Request["TxMsg"];           
            string pgTxnId = Request["pgTxnNo"];
            string issuerRefNo = Request["issuerRefNo"];
            string authIdCode = Request["authIdCode"];
            string firstName = Request["firstName"];
            string lastName = Request["lastName"];
            string pgRespCode = Request["pgRespCode"];
            string zipCode = Request["addressZip"];
            string resSignature = Request["signature"];
       
            bool flag = true;
            if (txnId != null)
            {
                data += txnId;
            }
            if (txnStatus != null)
            {
                data += txnStatus;
            }
            if (amount != null)
            {
                data += amount;
            }
            if (pgTxnId != null)
            {
                data += pgTxnId;
            }
            if (issuerRefNo != null)
            {
                data += issuerRefNo;
            }
            if (authIdCode != null)
            {
                data += authIdCode;
            }
            if (firstName != null)
            {
                data += firstName;
            }
            if (lastName != null)
            {
                data += lastName;
            }
            if (pgRespCode != null)
            {
                data += pgRespCode;
            }
            if (zipCode != null)
            {
                data += zipCode;
            }
      
            // Get a secret key from web.config or database server.
            //string secret_key = ConfigurationManager.AppSettings["secret_key"].ToString();

            DataTable dtPaymentInfo = null;
            string secret_key = "";
            DevCommon.Select("SPSelectApplicationPaymentDetailByTxId",
       ref dtPaymentInfo, Convert.ToString(txnId));
            if (dtPaymentInfo != null && dtPaymentInfo.Rows.Count > 0)
            {
                secret_key = Convert.ToString(dtPaymentInfo.Rows[0]["secret_key"]);
            }
            System.Security.Cryptography.HMACSHA1 myhmacsha1 = new
       System.Security.Cryptography.HMACSHA1(
            System.Text.Encoding.ASCII.GetBytes(secret_key));
            System.IO.MemoryStream stream = new
            System.IO.MemoryStream(System.Text.Encoding.ASCII.GetBytes(data));
            string signature =
       BitConverter.ToString(myhmacsha1.ComputeHash(stream)).Replace("-", "").ToLower();

            if (resSignature != null && !signature.Equals(resSignature))
            {
                flag = false;
            }

            if (flag)
            {
                DataTable datatable = null;
                object[] objPara = new object[14];
                objPara[0] = Convert.ToInt32(Session["ApplicationFormId"]);
                objPara[1] = txnId;
                objPara[2] = TxRefNo;
                objPara[3] = txnStatus;
                objPara[4] = amount;
                objPara[5] = TxMsg;
                objPara[6] = pgTxnId;
                objPara[7] = issuerRefNo;
                objPara[8] = authIdCode;
                objPara[9] = firstName;
                objPara[10] = lastName;
                objPara[11] = pgRespCode;
                objPara[12] = zipCode;
                objPara[13] = signature;
           

                   // Update transaction status in database and make sure your database
                   //amount and tansaction amount both are same while update transaction
                //status(eg. SUCCESS).
                DevCommon.InsertUpdate("SPUpdatePaymentDetails", ref datatable, objPara);
                if (datatable != null && datatable.Rows.Count > 0 &&
                   Convert.ToInt64(datatable.Rows[0][0]) > 0)
                {
                      // after successful update redirect to payment receipt for payment details.
                   //create payment reciept page as your requirement.
                    Response.Redirect("PaymentReceipt.aspx?txnId=" +
                       EncryptDecrypt.Encrypt(Convert.ToString(txnId), "P@ssw0rd"),false);
                }
            }
            else
            {
                Response.Redirect("default.aspx");
            }
        }
        catch (Exception ex)
        {
            // mail to Admin if fail to update status in database and redirect
       // to another page.           
            Response.Redirect("default.aspx");
        }

    }
}