if ($('#<%=GridView1.ClientID%> input:checkbox:checked').length > 0) {
alert('selected');
}
else {
alert('Not Selected');
}
Blogger news
Sunday, 23 June 2013
-- Asp.net Embedded InLine Code Binding --
<%@ Page Language="C#" %>
<% Response.Write("Hello World!"); %>
<%= SayHello("Ahmed") %>
<%: DateTime.Now.ToString() %>
<%$ ConnectionStrings:ConnStrFromWebConfig %>
<%$ AppSettings:ValueFromWebConfig %>
<%$ Resources:Resource, Arabic %>
<%$ RouteValue:year %>
<%$ YourExpressionPrefix : Any %>
<%# Eval("Name") %>
<%# Bind("Name") %>
<%# XPath ("Name") %>
<%--
Tuesday, 14 August 2012
Reseed/Reset Table Identity Value
DBCC CHEKIDENT Used To Reset Your Table Value
For Example
For Example
If We Want Next Record To Have Identity As 135 We Need To Run Sql Query To :
DBCC CHECKIDENT (yourTABLEname, reseed, 134)
Thursday, 9 August 2012
WebService , Ajax
<script type="text/javascript">
$(document).ready(function(){
$("#Customers").change(function(){
//Using Load Method
$("#CustomerDetails").load("FetchCustomer.aspx?CustomerID=" + $('#Customers').val());
});
//Using getMethod
$.get("FetchCustomer.aspx",
{ CustomerID: "" + $('#Customers').val() + "" },
function(data){
$('#CustomerDetails').html(data);
});
//Using Ajax Method
$.ajax({
contentType : "text/html;charset=utf-8",
data:"CustomerID="+$('#Customers').val(),
url:"FetchCustomer.aspx",
dataType:"html",
success:function(data){
$('#CustomerDetails').html(data);
}
});
});
});
</script>
Tuesday, 7 August 2012
Drop All Procedures
DECLARE @name VARCHAR(128)
DECLARE @SQL VARCHAR(254)
SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 ORDER BY [name])
WHILE @name is not null
BEGIN
SELECT @SQL = 'DROP PROCEDURE [dbo].[' + RTRIM(@name) +']'
EXEC (@SQL)
PRINT 'Dropped Procedure: ' + @name
SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 AND [name] > @name ORDER BY [name])
END
GO
Thursday, 26 April 2012
C# Sql Connection String
connetionString="Data Source=ServerName; Initial Catalog=DatabaseName;User ID=UserName;Password=Password"cnn = new SqlConnection(connetionString);
Example
string connetionString = null;
SqlConnection cnn ;
connetionString = "Data Source=ServerName;Initial Catalog=DatabaseName;User ID=UserName;Password=Password"
cnn = new SqlConnection(connetionString);
try
{
cnn.Open();
MessageBox.Show ("Connection Open ! ");
cnn.Close();
}
catch (Exception ex)
{
MessageBox.Show("Can not open connection ! ");
}
Subscribe to:
Posts (Atom)