Sunday, March 20, 2011
Page Event Life Cycle in ASP.NET
ASP.NET 3.5 LINQ TO SQL
Insert,Update,Delete Operations in ASP.NET Gridview
Generics In .NET( ASP.NET,C#.NET,VB.NET)
Generics In .NET( ASP.NET,C#.NET,VB.NET)
Labels:
.NET Tutorial Videos,
Collections,
Generics
Sunday, March 13, 2011
Drag and Drop in ASP.NET by using JavaScript
Drag and Drop Concept in ASP.NET by using JavaScript
<html>
<head>
<title>Membership Approval Drag and Drop Testing</title>
<script language="javascript" type="text/javascript">
//////////Drag and Drop Code goes here only
///////////This code will work on Firefox,Opera, Safari,Chrome/////////////////////////////////////////Rama SubbaReddy
var dragitem = undefined;
function setdragitem(item, evt)
{
dragitem = item;
// evt.preventDefault();
return true;
}
function cleardragitem()
{
dragitem = undefined;
//alert(dragitem +"non-IE");
// alert('item: '+item);
}
function dodrag()
{
//alert('item: '+dragitem.alt);
}
function handledragenter(elt, evt)
{
if (!evt)
{
evt = window.event || event;
}
evt.returnValue = false;
}
function handledragover(elt, evt)
{
dragitem.className = "variable_selected";
if (!evt)
{
evt = window.event || event;
//alert(event);
}
evt.returnValue = false;
}
function handledragleave(elt, evt)
{
dragitem.className = "variable_selected";
}
function handledrop(elt, evt)
{
var dragvalue;
if (dragitem.nodeName == "IMG")
{
dragvalue = dragitem.alt;
//alert(dragvalue);
}
else
{
dragvalue = dragitem.innerText ? dragitem.innerText :dragitem.textContent;
//alert(dragvalue);
}
var DragItemvalue = dragvalue;
//alert(dragitem.id);
//alert(dragvalue);
//alert(DragItemvalue);
var txt = document.getElementById("txtEmailBody");
alert(txt.value);
var mosPos = 0;
if (document.selection)
{
txt.focus();
var range = document.selection.createRange();
range.text = DragItemvalue;
DragItemvalue = "";
}
else if (txt.selectionStart != null)
{
mosPos = txt.selectionStart;
var strFirst = txt.value.substring(0, mosPos);
var strLast = txt.value.substring(mosPos);
if (txt.value == "")
{
txt.value = DragItemvalue;
DragItemvalue = "";
//alert(txt.value +":insideempty");
txt.focus();
}
else
{
txt.value = strFirst + DragItemvalue + strLast;
DragItemvalue = "";
//alert(txt.value + ":insideelse");
txt.focus();
}
dragitem.className = "variable_selected";
//alert(txt.value + ":outside");
}
}
</script>
</head>
<body>
<input type="text" name="EmailBody" id="txtEmailBody" ondragenter='handledragenter(this, event);' rows="39" cols="45" ondragover='handledragover(this, event);' ondragleave='handledragleave(this, event);' ondrop='handledrop(this, event);' />
<table style="width: 100%;" cellpadding="5" cellspacing="0" border="0" bgcolor="liteblue" width="30%">
<tr>
<td width="20%" bgcolor="yellow">
Drag Variables</td>
</tr>
<tr>
<td class="variable_list_td">
<img src="grippy.png" alt="[MemberID]" ondragstart='setdragitem(this, event);' ondrag='dodrag();' title="MemberID" /> [MemberID]
</td>
</tr>
<tr>
<td>
<img src="grippy.png" title="CompanyName" alt="[CompanyName]" ondragstart='setdragitem(this, event);' ondrag='dodrag();'/> [CompanyName]
</td>
</tr>
<tr>
<td class="variable_list_td">
<img src="grippy.png" title="ProfessionalTitle" alt="[ProfessionalTitle]"
ondragstart='setdragitem(this, event);' ondrag='dodrag();' />
[ProfessionalTitle]
</td>
</tr>
</table>
</body>
</html>
Check your OUTPUT here:
<html>
<head>
<title>Membership Approval Drag and Drop Testing</title>
<script language="javascript" type="text/javascript">
//////////Drag and Drop Code goes here only
///////////This code will work on Firefox,Opera, Safari,Chrome/////////////////////////////////////////Rama SubbaReddy
var dragitem = undefined;
function setdragitem(item, evt)
{
dragitem = item;
// evt.preventDefault();
return true;
}
function cleardragitem()
{
dragitem = undefined;
//alert(dragitem +"non-IE");
// alert('item: '+item);
}
function dodrag()
{
//alert('item: '+dragitem.alt);
}
function handledragenter(elt, evt)
{
if (!evt)
{
evt = window.event || event;
}
evt.returnValue = false;
}
function handledragover(elt, evt)
{
dragitem.className = "variable_selected";
if (!evt)
{
evt = window.event || event;
//alert(event);
}
evt.returnValue = false;
}
function handledragleave(elt, evt)
{
dragitem.className = "variable_selected";
}
function handledrop(elt, evt)
{
var dragvalue;
if (dragitem.nodeName == "IMG")
{
dragvalue = dragitem.alt;
//alert(dragvalue);
}
else
{
dragvalue = dragitem.innerText ? dragitem.innerText :dragitem.textContent;
//alert(dragvalue);
}
var DragItemvalue = dragvalue;
//alert(dragitem.id);
//alert(dragvalue);
//alert(DragItemvalue);
var txt = document.getElementById("txtEmailBody");
alert(txt.value);
var mosPos = 0;
if (document.selection)
{
txt.focus();
var range = document.selection.createRange();
range.text = DragItemvalue;
DragItemvalue = "";
}
else if (txt.selectionStart != null)
{
mosPos = txt.selectionStart;
var strFirst = txt.value.substring(0, mosPos);
var strLast = txt.value.substring(mosPos);
if (txt.value == "")
{
txt.value = DragItemvalue;
DragItemvalue = "";
//alert(txt.value +":insideempty");
txt.focus();
}
else
{
txt.value = strFirst + DragItemvalue + strLast;
DragItemvalue = "";
//alert(txt.value + ":insideelse");
txt.focus();
}
dragitem.className = "variable_selected";
//alert(txt.value + ":outside");
}
}
</script>
</head>
<body>
<input type="text" name="EmailBody" id="txtEmailBody" ondragenter='handledragenter(this, event);' rows="39" cols="45" ondragover='handledragover(this, event);' ondragleave='handledragleave(this, event);' ondrop='handledrop(this, event);' />
<table style="width: 100%;" cellpadding="5" cellspacing="0" border="0" bgcolor="liteblue" width="30%">
<tr>
<td width="20%" bgcolor="yellow">
Drag Variables</td>
</tr>
<tr>
<td class="variable_list_td">
<img src="grippy.png" alt="[MemberID]" ondragstart='setdragitem(this, event);' ondrag='dodrag();' title="MemberID" /> [MemberID]
</td>
</tr>
<tr>
<td>
<img src="grippy.png" title="CompanyName" alt="[CompanyName]" ondragstart='setdragitem(this, event);' ondrag='dodrag();'/> [CompanyName]
</td>
</tr>
<tr>
<td class="variable_list_td">
<img src="grippy.png" title="ProfessionalTitle" alt="[ProfessionalTitle]"
ondragstart='setdragitem(this, event);' ondrag='dodrag();' />
[ProfessionalTitle]
</td>
</tr>
</table>
</body>
</html>
Check your OUTPUT here:
Available Variables | ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
Friday, March 11, 2011
ASP.NET AJAX 2.0 Extension
ASP.NET AJAX Extension
ASP.NET AJAX Extension
ASP.NET AJAX Extension
Subscribe to:
Posts (Atom)