You are currently browsing the daily archive for February 25, 2011.
[WebMethod]
public static string FolderNameExist(string name, string id) {
DbFunctions db = new DbFunctions();
SqlCommand cmd = new SqlCommand(“SELECT * FROM Table”);
string result = db.ExecuteScalar(cmd);
return result == “0″ ? “OK!” : “*Folder name exist.”;
}
$.ajax({
type: “POST”,
url: “/FolderMgt.aspx/FolderNameExist”,
data: “{ \”name\” : \”" + $textbox.val() + “\”, \”id\” : \”" + $(“#hidId”).val() + “\” }”,
contentType: “application/json; charset=utf-8″,
dataType: “json”,
success: function(response) {
$span.html(response.d);
},
error: function(result) { alert(result.status + ‘ ‘ + result.statusText); }
});
var regWordonly = /[^a-zA-Z0-9_\-]/g;
text = text.replace(regWordonly, “”);

Recent Comments