Call web method using jquery asp.net

Call web method using jquery asp.net ajax:

function SearchInterventionQuestions() {
$("#divSearchInterventionQuestions").html('');
//debugger;
//var welcomePageURL = document.getElementById("hdnCreateSurveyQuestionsURL");
var createInterventionQuestionsURL = "../Modules/WebForms/InterventionExercise/CreateHappinessExercise.aspx";
var searchText = $("#txtSearchInterventionQuestion")[0].value;
$.ajax({
type: "POST",
url: createInterventionQuestionsURL + "/SearchInterventionQuestion",
data: '{question: "' + searchText + '" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSearchInterventionQuestionsSuccess,
failure: function (response) {
alert(response);
}
});
return false;
}

function OnSearchInterventionQuestionsSuccess(response) {
$("#divSearchInterventionQuestions").html(response.d);
return false;
}

Removing Shared Folders - IT Security Guidelines - IT Security - Trinity College Dublin

Remove Shared Folders

Perform the following steps to remove shared folders which you no longer use.

Windows 2000/XP :

  1. Right click My Computer -> Select 'Manage'.

  2. Choose 'Shared Folders'.

  3. On the list expand shared folders and select the 'Shares' folder.

  4. To disable any share you are not using right click on the shared folder and choose 'Stop Sharing' as in the image below.

stop file sharing

Remember - Ignore the shares with '$' after them these are default administration shares and are required.


Thanks to tcd.ie

Merge GridView Cells Or Columns in Row ASP.NET C#

Merge GridView Cells Or Columns in Row ASP.NET C#

In most of the cases specially for reporting purpose we need to merge GridView cells or columns for client preferred output. In this example i will show you how one can merge GridView cells or columns in asp.net C#. My special focus is on to merge cells when both contains same or equal data. So that the GridView looks like a traditional report.

///////////////////////////////////////////////////////

using System;
using System.Web.UI.WebControls;

public class clsUIUtility
{
public clsUIUtility()
{
}

public static void GridView_Row_Merger(GridView gridView)
{
for (int rowIndex = gridView.Rows.Count - 2; rowIndex >= 0; rowIndex--)
{
GridViewRow currentRow = gridView.Rows[rowIndex];
GridViewRow previousRow = gridView.Rows[rowIndex + 1];

for (int i = 0; i < currentRow.Cells.Count; i++)
{
if (currentRow.Cells[i].Text == previousRow.Cells[i].Text)
{
if (previousRow.Cells[i].RowSpan < 2)
currentRow.Cells[i].RowSpan = 2;
else
currentRow.Cells[i].RowSpan = previousRow.Cells[i].RowSpan + 1;
previousRow.Cells[i].Visible = false;
}
}
}
}
}

////////////////////////////////////////////

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridView_Merge.aspx.cs" Inherits="GridView_Merger" %>





How to merge GridView cell or Column









       
       
       
       
           
           
           
       

       
   





///////////////////////////////////////////

< Hope now you can merge all of your GridView Cells Or Columns in Row using ASP.NET C# within your project by writing a single line. Just call the clsUIUtility.GridView_Row_Merger method and send the GridView that you want to merge for all applicable Gridviews in your project.

There is a lot of scope to modify the generic method if GridView rows contain controls like DropDwonList, CheckBoxList, RadioButtonList etc. in a template column.

How to display loading GIF Image In JQuery AJAX in ASP.NET

Introduction

Today’s JQuery is most powerful library for web development GUI customization. Hence I would write another great article about how to display the wait or loading GIF using JQuery with when you are call AJAX Load method. Let’s say you have to load list of state based on your selected country. In this scenario, we can use the AJAX Load with div element.

Now, let say we have to show the loading gif one we are select the country, then AJAX load has request to get the states content from the database. Here is followings steps will be happen internally

1. Something triggers AJAX request (select a country).
2. We put the loading image that asks for user patience to the place where we would later insert the loaded list of state list in the html element (div).
3. After remote content is fully loaded, the content will replace earlier div html by this new content.

Note: before start the demonstration, you have to download JQuery library from jquery.com or you can point the Google JQuery API URL as well.


Now, design the page for load state list, when we select a country.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CountryDemo.aspx.cs" Inherits="WebApplication1.CountryDemo" %>


Note:I have used JQuery library from Google API.

What are the advantages of use Google JQuery URL ?

Here whole details for this question.

Now let’s write JavaScript code with JQuery library to load state once we select the a country









Through the above code ,when we are select a country, then change event will raise and send country ID to server page1.aspx.Within the page1.aspx, will compose the state list as html format, finally will write as response to client. But here now you can’t see any loading or wait GIF image when you are select a country from country dropdown list.


Let’s see, how to implement that, just an additional line we have to add within above script.


In above code, i have added only this line to load GIF.

$('#mainContent').empty().html('');
Once change event raised, GIF loading image wild add into div inner content, Once content from loaded from the server page, then .load() function would replace our loading image indicator with the loaded content.The $('#mainContent').empty() will clear inner html of the div,and then when we are call $('#mainContent').empty().html() method will add new element inside the div.

Conclusion

here I have not give the sample project with article. because I have given core part of the implementation with this article. So I hope you able to catch and enjoy.

Keep ur coding aside.. Relax for some time..