var message="Sorry, Right Click is disabled.";
function click(e)
{
if (document.all)
{
if (event.button == 2)
{
alert(message);
return false;
}
}
if (document.layers)
{
if (e.which == 3)
{
alert(message);
return false;
}
}
}
if (document.layers)
{
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
25 February 2009
12 February 2009
Filter dataset
Dataset.Tables[0].DefaultView.RowFilter = "Id not in(" + tmpItemIds + ") and Name like '%" + txtSearch.Text + "%'";
BusinessCommon.FillDataBoundControl(grvItem, Dataset.Tables[0].DefaultView);
BusinessCommon.FillDataBoundControl(grvItem, Dataset.Tables[0].DefaultView);
Set cursor position Last ( TextBox )
function setCursorPosition(elementRef, cursorPosition)
{
if ( typeof elementRef == 'string' )
elementRef = document.getElementById(elementRef);
if ( elementRef != null )
{
if ( elementRef.createTextRange )
{
var textRange = elementRef.createTextRange();
textRange.move('character', cursorPosition);
textRange.select();
}
else
{
if ( elementRef.selectionStart )
{
elementRef.focus();
elementRef.setSelectionRange(cursorPosition, cursorPosition);
}
else
{
elementRef.focus();
}
}
}
}
--------------------
ScriptManager.RegisterStartupScript(this, this.GetType(), "k", "setCursorPosition('" + TextBox2.ClientID + "'," + TextBox2.Text.Length + ");", true);
{
if ( typeof elementRef == 'string' )
elementRef = document.getElementById(elementRef);
if ( elementRef != null )
{
if ( elementRef.createTextRange )
{
var textRange = elementRef.createTextRange();
textRange.move('character', cursorPosition);
textRange.select();
}
else
{
if ( elementRef.selectionStart )
{
elementRef.focus();
elementRef.setSelectionRange(cursorPosition, cursorPosition);
}
else
{
elementRef.focus();
}
}
}
}
--------------------
ScriptManager.RegisterStartupScript(this, this.GetType(), "k", "setCursorPosition('" + TextBox2.ClientID + "'," + TextBox2.Text.Length + ");", true);
Subscribe to:
Comments (Atom)