DotNet By Satya

Blog that contains articles about new technologies related or not with programming. I will describe and solves some problems that I encounter in my career. ASP .NET, AJAX, Javascript, C++, C# and SQL are some of the subjects that will appear.

28 June 2012

clear all cotrol values of a page

›
<script type="text/javascript">     function allclear()     {    //debugger         var elements=document.getElementsByTagNa...

make listbox items colorful

›
protected void Page_PreRender(object sender, EventArgs e) {     bool flag=false;     foreach (ListItem li in ListBox1.Items)     {         i...

make webpage title scrolling

›
<script type="text/javascript">     msg = "MyWebPageTitle";     msg = "..." + msg;pos = 0;     function ...

javascript handlers

›
// Add handler using the getElementById method $addHandler(Sys.UI.DomElement.getElementById("Button1"), "click", toggleC...

String formats

›
String strVal = "a(1), a1(2), a.3(3), a'4 (4), a.5:(5)"; Regex.Replace(strVal, @"[\w\s';.&,:]+\((\d+)\)", ...
01 June 2012

image file path to byte[] format

›
private byte[] imgStream(string filePath) { MemoryStream stream = new MemoryStream(); tryagain: try { Bitmap bmp = new Bitmap(filePath);   b...
25 May 2012

Get RowCount all tables of a Database in SqlServer

›
SELECT [TableName] = O.name, [RowCount] =MAX(I.rows)FROM sysobjects O, sysindexes I WHERE O.xtype ='U'AND I.id =OBJECT_ID(O.name) GR...

Email validation javascript

›
function emailCheck(str) { var at="@"; var dot="."; var lat=str.indexOf(at); var lstr=str.length; var ldot=str.indexOf(d...
18 April 2012

Get current date n time in sqlserver

›
select current_timestamp go select {fn now()} go select getdate() go select convert(varchar,getdate(),101)* go sqlserver2005 -- select conve...
29 March 2012

get web.config appsettings in javascript

›
var conn = '<%=ConfigurationManager.ConnectionStrings["MyConnString"].ConnectionString %>' alert(conn); var v1 = ...
28 March 2012

restrict textbox to allow only numerics

›
function numerics() {  key = String.fromCharCode(window.event.keyCode);  if (!(key >= '0' && key <= '9'))   wi...
21 March 2012

check all checkboxes in a form

›
$(document).ready(function() {             $('#chkAll').click(              function() {                  $("INPUT[type='ch...

checkbox list javascript validation

›
function valid()     {           var chkBoxList = document.getElementById('<%=CheckBoxList11.ClientID %>');         var chkBox...
13 March 2012

Remove duplicates from an interger array

›
int[] a = { 1, 3, 2, 5, 6, 1, 2, 3 }; string s =","; for (int i = 0; i < a.Length - 1; i++) { if (!s.Contains("," + a...
07 March 2012

cookie in js

›
$.cookie('test', $('#Text1').val());
‹
›
Home
View web version

DotnetBySatya About

satyabhaviri
View my complete profile
Powered by Blogger.