Nettuts.com is a great site with many tutorials.
Here is a series of jQuery tutorials for beginners
Nettuts.com is a great site with many tutorials.
Here is a series of jQuery tutorials for beginners
Google Tech Talks
September 5, 2006
Ken Schwaber co-developed the Agile process, Scrum. He is a founder of the Agile Alliance and Scrum Alliance, and signatory to the Agile Manifesto. Ken has been a software developer for over thirty years. He is an active advocate and evangelist for Agile processes.
ABSTRACT
Scrum is an amazingly simple process that causes many, many changes when it is implemented. This seminar presents the basic framework of Scrum and some of the implementation issues associated with it.
Speaker:Ken Schwaber
I’m reinstalling Windows on my work computer and wanted to preserve all the current Visual Studio settings.
In case you didn’t know how it is done:
1. Open Visual Studio
2. Go to Tools->Import and Export Settings
3. Choose “Export selected…”
4. Choose which settings you want to export
5. Choose filename and location
6. Done :)
7. All you need to do now is to go to same menu on other VS and select import.
This is a nice script that can convert your Google search page from this:
to this:
Features (From the developers page):
Install it from here
* For some reason the script registers with a specific domain name, so I had to change it manually to:
DropDownList SelectedValue:
GET: $('#<%=DropDownList1.ClientID%>').val();
SET: $('#<%=DropDownList1.ClientID%>')
.val("value_to_set");
RadioButtonList SelectedValue:
$("input[name='<%=RadioButtonList1
.UniqueID%>']:checked").val();
Button Enable/Disable
$('#<%=Button1.ClientID%>').attr("disabled", true/false);
Label Text
GET: $('#<%=Label1.ClientID%>').text();
SET: $('#<%=Label1.ClientID%>').text("value_to_set");
TextBox Text
GET: $('#<%=TextBox1.ClientID%>').val();
SET: $('#<%=TextBox1.ClientID%>').val("value_to_set")
Check Visibility
if ($('#<%=Button1.ClientID%>').is(':visible'));
I got this amazing tip from an article named “5 tips for better jQuery code”.
This is a great way to associate any amount of data with any element on the page, here is a small example:
<html>
<head>
<title>jQuery Data() method</title>
<script src="scripts/jquery/jquery-1.2.6.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
//create meaningless list
for(var i=0;i < 10;i++)
{
$("#list").append("<li>" + i + "</li>");
}
var prevSum = 0;
//will show the pwr of index and sum with all previous items
$("#list li").each(function(indx, obj)
{
prevSum = prevSum + indx;
//attach data to each list item
$(this).data("Data", {pwr: indx*indx, sum: prevSum });
//Show it
$(this).html($(this).html() + ": pwr=" + $(this).data("Data").pwr + ",sum=" + $(this).data("Data").sum);
});
});
</script>
</head>
<body>
<ul id="list">
<!--the items will be added here -->
</ul>
</body>
</html>
Nice!
The interesting part is that the data is not shown in the source code…
jQuery $.each can be used in order to iterate over an array:
$(document).ready(function() {
var arr = [ "a", "b", "c", "d", "e" ];
$.each(arr,function(index, item)
{
$('#list').append($( "<li>" + item + " at " + index +"</li>" ));
});
});
You should have a <ul> with id=list for this code to work:
<ul id="list">
<!--the items will be added here -->
</ul>
The result is:
Here is the entire code:
<html>
<head>
<title>jQuery Array Iteration</title>
<script src="scripts/jquery/jquery-1.2.6.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var arr = [ "a", "b", "c", "d", "e" ];
$.each(arr,function(index, item)
{
$('#list').append($( "<li>" + item + " at " + index +"</li>" ));
});
});
</script>
</head>
<body>
<ul id="list">
<!--the items will be added here -->
</ul>
</body>
</html>
Important to note that this is not the same as $(‘DOMElement’).each().
<script type="text/javascript">
// Get the instance of PageRequestManager.
var pageReq = Sys.WebForms.PageRequestManager
.getInstance();// Add initializeRequest and endRequest
pageReq.add_initializeRequest(pageReq_InitializeRequest);pageReq.add_endRequest(pageReq_EndRequest);// Called when async postback begins
function pageReq_InitializeRequest(sender, args) {
}// Called when async postback ends
function pageReq_EndRequest(sender, args) {
}</script>
I have decided to clean my hard drive lately, here are some things I did:
Deleted the Vista SP1 installation files (they are only needed if you plan to remove SP1, which I don’t)
Disabled hibernate (this is desktop, don’t need it…)
Got 10 GB back :)
DevEnv.exe /installvstemplates
The file is located (for vs2005) at:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
A great explanation about where and how errors can be caught in ASP.NET application and how to build custom error pages.
When presenting an original idea to others - it can be presented as a mash-up of couple of well known ideas.
Cloverfield = Blair Witch Project + Godzilla
LinkedIn = Facebook + Business Contacts
It will not cover all the nuances of your idea, but it will give your listeners some anchor to relate to that idea, which gives you a good start point.
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" media="screen" href="other.css" />
<![endif]-->
lt - means "less then" - will link another css only for browsers less then IE7
$(document).ready(function() { $().mousemove(function(e) { $('p').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY); }); });
1. Dim dv As New System.Data.DataView
2. Dim dt As New System.Data.DataTable
3. dv = mySQLDataSource.Select(DataSourceSelectArguments.Empty)
4. dt = dv.ToTable()
Say you have your main page, which is just a frameset. All the navigation occurs within that frameset, such that going from page1 to page2 merely updates the frame's url, it doesn't re-create the host page. This leaves the host page intact, including it's JavaScript state. Therefore, you could have a JavaScript variable persist data between pages.
<html>
<head>
<title>My App</title>
<script language="javascript" type="text/javascript">
var _javaScriptVar = null;
</script>
</head>
<frameset>
<frame src="Page1.aspx" id="mainFrame">
</frameset>
</html>
You could then reference this variable from your child pages via the DOM:
window.parent._javaScriptVar = "someValue";
Put your cursor before or after the brace (your choice) and then press Ctrl+].
Took me a lot of time to figure it out...
First, paging doesn't seem to work when ObjectDataSource Select function returns SqlDataReader so it returns DataView now.
The code looks like this:
1: [DataObjectMethod(DataObjectMethodType.Select)]
2: public static DataView GetRows(int statusid, int experienceid, string submitter, string idsid, string SortExpression)
3: {
4:
5: StringBuilder strSql = MainSelectSql(idsid, statusid, experienceid, submitter, SortExpression);
6:
7: SqlConnection connection = Connection.GetConnection();
8: SqlCommand command = new SqlCommand(strSql.ToString(), connection);
9: command.CommandType = CommandType.Text;
10: SqlDataAdapter adapter = new SqlDataAdapter(command);
11:
12: //connection.Open();
13: DataTable dt = new DataTable();
14: adapter.Fill(dt);
15: connection.Close();
16: int totalRecords = dt.Rows.Count;
17:
18: DataView dw = new DataView(dt);
19:
20: return dw;
21: }
The GridView has to have its "AllowPaging" set to true and PageIndexChanging method looks like this:
1: protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
2: {
3: GridView gv = (GridView)sender;
4: gv.PageIndex = e.NewPageIndex;
5: gv.DataBind();
6: }
Also can change the page size in properties...
This will be useful for GridView pagination:
An aggregate functions can be added to any SELECT (even without a GROUP BY clause) by specifying an OVER() partition for each function.
This means that this code:
1: select
2: o.customerID, o.productID, o.orderDate, o.orderAmount, t.Total
3: from
4: Orders o
5: inner join
6: (
7: select customerID, sum(orderAmount) as Total from Orders group by customerID
8: )
9: t on t.customerID = o.customerID
can be replaced with:
1: select customerID, productID, orderDate, orderAmount,
2: sum(orderAmount) OVER (Partition by CustomerID) as Total
3: from Orders
Great articles from Learning jQuery blog:
Found the solution on Google Groups (Google Reader Help):
1. In a Firefox window, enter "about:config" in the address bar.
2. In the "Filter" field, type "popup_maximum".
3. One preference, called "popup_maximum" appears; double-click the
"value" number.
4. Enter a new, appropriately large value. I used 2000, just to be on
the safe side.
1: SELECT
2: substring(IdeaText,1,
3: charindex('//', IdeaText)
4: ) as part1
5: FROM tblIdeas
1: public partial class _Default : Page
2: {
3: [WebMethod]
4: public static string GetDate()
5: {
6: return DateTime.Now.ToString();
7: }
8: }
1: <html>
2: <head>
3: <title>Calling a page method with jQuery</title>
4: <script type="text/javascript" src="jquery-1.2.6.min.js"></script>1:
2: <script type="text/javascript" src="Default.js"></script>
5: </head>
6: <body>
7: <div id="Result">Click here for the time.</div>
8: </body>
9: </html>
1: $(document).ready(function() {
2: // Add the page method call as an onclick handler for the div.
3: $("#Result").click(function() {
4: $.ajax({
5: type: "POST",
6: url: "Default.aspx/GetDate",
7: beforeSend: function(xhr) {
8: xhr.setRequestHeader("Content-type",
9: "application/json; charset=utf-8");
10: },
11: dataType: "json",
12: success: function(msg) {
13: // Replace the div's content with the page method's return.
14: $("#Result").text(msg.d);
15: }
16: });
17: });
18: });