$(document).ready(function () { $(document).keydown(function (event) { if (globalPageMode == ‘edit’) { if (event.ctrlKey && event.keyCode == 83) { if ($(“#ButtonSave”).is(‘:disabled’) == false) // is the button enabled $(“#ButtonSave”).trigger(‘click’); return false; //if button is enabled then … $(“#ButtonSave”).trigger(‘click’); //trigger click event of the button } } }); });
Archive for the ‘ASP.NET’ Category
Some jQuery to check button disabled attach keydown event and trigger click
Posted: November 6, 2009 in ASP.NET, javascript, jQueryTags: Event, jQuery
Event, KeyPress in IE and firefox and preventDefault or return false
Posted: October 1, 2009 in ASP.NET, C#, javascriptTags: Event, event firefox, event IE, KeyPress, preventDefault, window.event.returnValue = false
var event = e || window.event; var keyCode = event.which || event.keyCode; if (keyCode == 83) // && event.ctrlkey) { if (event.ctrlKey) { var bt = document.getElementById(‘ButtonSave’); // Do something… if (e && e.preventDefault) { // DOM default for Firefox, safari, Opera and NN e.preventDefault(); return false; } else { //window.event.returnValue = false; return false; [...]
WebRequest AND HttpWebRequest to get Image from Server
Posted: October 1, 2009 in ASP.NET, C#Tags: get Image from Server, HttpWebRequest, WebRequest, WebRequest Image
WebRequest AND HttpWebRequest to get Image from Server
//var o = from p in db.t1 // join p2 in db.t2 on new { f1 = p.c1, f2 = “n” } equals new { f1 = p2.c2, f2 = p2.c3 } into temp // from x in temp.DefaultIfEmpty() // select new { f1 = p.c1, f2 = x.c2, f3 = x.c3 }; //var q [...]
Regex for hour (Example 0-23.99)
Posted: September 15, 2009 in ASP.NET, C#Tags: 0-23, 0-23:59, hour, regex
Expression: ^([0-1]?\d|2[0-3])([\.,]\d{1,2})?$ Regular Expression for 0-23.99
SQL 2005 and SQL2008 Enabling Notifications. SQL Chache Dependancy Part-I
Posted: February 18, 2008 in ASP.NET, C#, SQLTags: SQL Chache Dependancy, SQL Notification, SQL2005
The only configuration step you need to perform is to make sure your database has the ENABLE_BROKER flag set. Use Northwind ALTER DATABASE Northwind SET ENABLE_BROKER Notifications work with SELECT queries and stored procedures. However, some restrictions exist for the SELECT syntax you can use. To properly support notifications, your command must adhere to the [...]