Thursday, April 16, 2009

Convert Raw HTML to Escaped HTML for blog

quick escape a tool that lets you quickly paste in HTML and for that to be converted to escaped characters - for example converting < a > to <a> - which can then be pasted back in to your HTML source code so that it renders on screen in code samples and the like.


http://www.accessify.com/tools-and-wizards/developer-tools/quick-escape/default.php

Scriptaculous script.aculo.us

script.aculo.us is a JavaScript library built on the Prototype JavaScript Framework, providing dynamic visual effects and user interface elements via the Document Object Model.

It is most notably included with Seaside and Ruby on Rails, but also provided separately to work with other web application frameworks and scripting languages.




<html>
<head>
<title>script.aculo.us examples</title>

<script type="text/javascript"
src="/javascript/prototype.js"></script>
<script type="text/javascript"
src="/javascript/scriptaculous.js?load=effects"></script>
<script type="text/javascript">

function ShrinkEffect(element){
new Effect.Shrink(element, {duration:3});
}

function ShowImage(element){
new Effect.Appear(element,{duration:1, from:1, to:1.0});
}

</script>
</head>
<body>

<div onclick="ShowImage('myimage')">
Click me to display the image
</div>
<br />
<div id="myimage" onclick="ShrinkEffect(this);">
<img src="/images/scriptaculous.gif" alt="script.aculo.us" />
<h2>Click me to Shrink me out</h2>
</div>

</body>
</html>

Wednesday, April 15, 2009

How to populate ListBox and DropDownList data with javascript

<strong>
< script type="text/javascript" >

function add()
{

AddListBox("sai","1");
AddListBox("sai2","2");
AddListBox("sai3","3");

}
function AddListBox(Text,Value)
{
var opt = document.createElement("option");
document.getElementById('<% =ListBox1.ClientID%>').options.add(opt);
opt.text = Text;
opt.value = Value;
}

</ script >

< body onLoad="add()">
<form id="form1" runat="server">
< div>

<asp:ListBox ID="ListBox1" runat="server" ></asp:ListBox>

</div>
</form>
</body>
</html>
</strong>

Passing parameters to user controls c# asp.net

Passing parameters to user controls c# asp.net
user control:
private string _InstructorFinderSide;
public string InstructorFinderSide
{
get { return _InstructorFinderSide; }
set { _InstructorFinderSide = value; }
}
From within the user control you can simply refer to "InstructorFinderSide" fromthereonin to get the value that was assigned to it by the parent.

Parent:Two methods
<-uc2:InstructorFC ID="InstructorFinder" InstructorFinderSide="right" runat="server"/>
in codebehind
InstructorFinderSide="right"

Thursday, April 9, 2009

How to Drag and Drop in JavaScript and jquery

<a href="http://www.webreference.com/programming/javascript/mk/column2/">http://www.webreference.com/programming/javascript/mk/column2/</a>
<a href="http://batiste.dosimple.ch/blog/posts/2008-05-18-1/jquery-drag-and-drop-and-resize-event-delegation.html">http://batiste.dosimple.ch/blog/posts/2008-05-18-1/jquery-drag-and-drop-and-resize-event-delegation.html</a>

<a href="http://fromvega.com/wordpress/2007/07/14/easydrag-jquery-plugin/">http://fromvega.com/wordpress/2007/07/14/easydrag-jquery-plugin/</a>


Jquery

http://thechriswalker.net/select-drag/

<script language="javascript" type="text/javascript">
$(document).ready(function(){ $(".block").draggable({helper:'clone'});
$(".drop").droppable({ accept: ".block", activeClass: 'droppable-active', hoverClass: 'droppable-hover', drop: function(ev, ui) { document.getElementById("display").innerHTML = $(ui.draggable).children("li:first").text();
var lid = ($(ui.draggable).children("li:first"));
var removeLink = document.createElement("a");
removeLink.innerHTML = "remove";
removeLink.href = "#"; removeLink.onclick = function() { $("#drop1").children().remove("#"+lid[0].id);
$(this).remove(); }
$(this).append($(ui.draggable).clone().children("li:first").addClass("blocker"));
$(this).append(removeLink); }}); });
</script>

And here is the HTML:

<?xml:namespace prefix = asp /><asp:datalist id="dlRooms" repeatdirection="Horizontal" repeatcolumns="3" runat="server"><p><%# Eval("tblRoom.Description") %></p></itemtemplate></asp:datalist>