Monday, November 29, 2010

Good topics related to AJAX

When to use GET and POST in AJAX -
http://javascript.about.com/od/ajax/a/ajaxgp.htm

See the links listed at the end of the page also

Wednesday, November 10, 2010

AJAX Toolkit examples here

http://www.asp.net/ajaxlibrary/act_tutorials.ashx

Good color combination for a Heading

Below heading is created using a Panel. It looks good on a normal white background (page's background I mean)


<asp:Panel ID="pReferralMethodHeader" runat="server" BackColor="#e7e7e7" Height="30px" ScrollBars="None">
<div style="padding: 5px; cursor: pointer; vertical-align: middle;">
<div style="float: left;" class="">
<font face="verdana" color="#993333" size="3"><b>Referral Method</b></font>
</div>
<div style="float: right; vertical-align: middle;">
<asp:ImageButton ID="imgReferralMethod" runat="server" ImageUrl="~/images/expand_blue.jpg"
AlternateText="(Show Claim Information Details...)" />
</div>
</div>
</asp:Panel>

Monday, November 8, 2010

CSS Inheritance

From http://dorward.me.uk/www/css/inheritance/

(Another good link is - http://www.webdesignfromscratch.com/html-css/css-inheritance-cascade/)

Multiple Classes

Making good use of classes will solve most problems. Take the example of having boxes of data floating on alternating sides of the canvas.

.oddBoxOut {
width: 12em;
float: left;
padding: 0.5em;
margin: 0.5em;
border: solid 1px black;
}

.evenBoxOut {
width: 12em;
float: right;
padding: 0.5em;
margin: 0.5em;
border: solid 1px black;
}

As you can see, many properties are duplicated in each definition, so it is obvious why somebody might want OO-style inheritance.

There is another solution though. Lets take a quick look back at the HTML specification:

class = cdata-list[CS]
This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters.

So we can assign multiple class names to a single element? That means we can change the style sheet so it looks like this:

.boxOut {
width: 12em;
padding: 0.5em;
margin: 0.5em;
border: solid 1px black;
}

.oddBoxOut {
float: left;
}

.evenBoxOut {
float: right;
}

And then the HTML will look like:

<div class="boxOut oddBoxOut">

Grouping Selectors

A single style may have multiple selectors assigned to it through the use of grouping.

To revisit the previous example, we first simplify the HTML so we only mention the one class:

<div class="oddBoxOut">

Then we assign the CSS we want to it, but we group the common property/value pairs.

.oddBoxOut,
.evenBoxOut {
width: 12em;
padding: 0.5em;
margin: 0.5em;
border: solid 1px black;
}

.oddBoxOut {
float: left;
}

.evenBoxOut {
float: right;
}

These two techniques should solve most problems which people think can be solved with OO-style inheritance, but we still have the option of using a preprocessor.

http://www.onlinetools.org/

Free Javascript scripts -
http://www.onlinetools.org/

Javascript examples: style.display & style.visibility & .disabled

document.getElementById("pnlSearch").style.display = "block";
document.getElementById("pnlSearch").style.display = "none";

document.getElementById("pnlSearch").style.visibility = "visible";
document.getElementById("pnlSearch").style.visibility = "hidden";

document.getElementById('btnSearch').disabled =false;
document.getElementById('btnSearch').disabled =true;

From http://stackoverflow.com/questions/133051/what-is-the-difference-between-visibilityhidden-and-displaynone : (See link for a short-but-great example) :
display:none means that the the tag in question will not appear on the page at all (although you can still interact with it through the dom). There will be no space allocated for it between the other tags. Visibility:hidden means that unlike display:none, the tag is not visible, but space is allocated for it on the page.

Saturday, November 6, 2010

Difference between DIV and SPAN tags

http://webdesign.about.com/od/htmltags/a/aa011000a.htm

The primary difference between the <span> and <div> tags is that <span> doesn't do any formatting of it's own. The <div> tag acts includes a paragraph break, because it is defining a logical division in the document. The <span> tag simply tells the browser to apply the style rules to whatever is within the <span>

Monday, November 1, 2010

Validate your CSS, XHTML; CSS Quirks

Excerpt from http://www.uwplatt.edu/web/wtc/div/boxmodel.html :

If you run into problems, go back and make sure you are accounting for all elements and all the properties. If you still are still having problems, validate your CSS, validate your XHTML, be sure to check the CSS Quirks Section, and if you are still having problems, consult an online resource

Good tutorial to learn about DIV, CSS (real HTML stuff)

http://www.uwplatt.edu/web/wtc/div/clear.html

One nice way to remember the components of CSS Box Model - MBIPC (like MPC, BIPC, etc in XII std in school)..
M - Margin (always transparent), B - Border, P - Padding, C - Content


http://www.uwplatt.edu/web/wtc/div/boxmodel.html

Wednesday, October 20, 2010

Asymmetric Encryption

Excerpt from http://www.4guysfromrolla.com/articles/021407-1.aspx

In asymmetric encryption two keys are generated per entity, one which is kept private and the other which is publicly known. The interesting and most important attribute of each of the two keys is that: each key undoes the other's operations, and it is computationally infeasible to generate the opposite key given one of the keys. As Figure 2 illustrates, if Bob wants to send a message to Alice, he uses Alice's public key to encrypt the message with. Later, when Alice wants to decrypt the message, she only needs to use her private key to do so. This method ensures that only Alice is able to read the messages encrypted with her public key.

The Art & Science of Storing Passwords (2006 article)

Good article about Storing Passwords
http://www.codeproject.com/KB/recipes/StoringPasswords.aspx

Excerpt from conclusion -
The simple guidelines are:

* If you need to retrieve passwords, use encryption.
* If you do not need to retrieve passwords, use hashes (more secure).
* Whatever you do, salt the passwords.

Tuesday, October 19, 2010

MultiTouch Vista

http://multitouchvista.codeplex.com/
Excerpt from http://www.drdobbs.com/windows/227701092

The great drawback is that you cannot emulate multitouch gestures with a mouse or a touchpad in your developer workstation. However, if you don't have a multitouch monitor, you still have a chance to test some multitouch gestures without having to deploy the project to the phone. There is an interesting project on CodePlex, Multi-Touch Vista that allows you to work with multiple mice to emulate two fingers on the screen and their multitouch gestures. In fact, the latest version of Multi-How to build a UI from scratch.

Multi-Touch Vista provides a Windows 7 compatible driver that enables multiple mice and is compatible with the Windows Phone 7 emulator. For example, you can use a laptop's touchpad as one of the pointers and a USB mouse connected to the same laptop as the second pointer. (If you're interested in working with Multi-Touch Vista, you can read an excellent step-by-step tutorial written by Michael Sync This tutorial explains how to install and configure the driver to work with the Windows Phone 7 emulator.)

When using post-cache substitution

From ASP.Net 3.5 Unleashed (pg 1318)
When you use post-cache substitution (declaratively or programmatically) then caching no longer happens beyond the web server. Using post-cache substitution causes a Cache-Control:no-cache HTTP header to be included in the HTTP response, which disables caching on proxy servers and browsers. This limitation is understandable because the substitution content must be generated dynamically with each page request.

Friday, October 15, 2010

Stored Procedures and PreCompilation

Whether they're precompiled depends on the database. In SQL Server, for instance, they're not. Stored procedures and parameterized SQL are both compiled before being run. A stored procedure can sometimes reuse an execution plan if a corresponding one exists...but so can parameterized SQL.
http://stackoverflow.com/questions/226859/disadvantage-of-stored-procedures

Stored procedures can be written in C#

http://www.sqlteam.com/article/writing-clr-stored-procedures-in-charp-introduction-to-charp-part-1

implementing-a-dynamic-where-clause

http://www.sqlteam.com/article/implementing-a-dynamic-where-clause

SELECT Cus_Name,
Cus_City,
Cus_Country
FROM Customers
WHERE Cus_Name = COALESCE(@Cus_Name,Cus_Name) AND
Cus_City = COALESCE(@Cus_City,Cus_City) AND
Cus_Country = COALESCE(@Cus_Country,Cus_Country)

Monday, October 11, 2010

Difference between <%= and <%#

The ASP.NET syntax <%# %> is a shorthand convention that instructs the runtime to execute whatever is contained within and output the results “in Line”.

Difference between <%= and <%# -
From http://blogs.msdn.com/b/dancre/archive/2007/02/13/the-difference-between-lt-and-lt-in-asp-net.aspx

  • The <%= expressions are evaluated at render time
  • The <%# expressions are evaluated at DataBind() time and are not evaluated at all if DataBind() is not called.
  • <%# expressions can be used as properties in server-side controls. <%= expressions cannot.

Monday, September 20, 2010

SET NOCOUNT ON

http://msdn.microsoft.com/en-us/library/ms189837.aspx
When SET NOCOUNT is ON, the count is not returned. When SET NOCOUNT is OFF, the count is returned.

The @@ROWCOUNT function is updated even when SET NOCOUNT is ON.

SET NOCOUNT ON prevents the sending of DONE_IN_PROC messages to the client for each statement in a stored procedure. For stored procedures that contain several statements that do not return much actual data, or for procedures that contain Transact-SQL loops, setting SET NOCOUNT to ON can provide a significant performance boost, because network traffic is greatly reduced.

Tuesday, September 14, 2010

Tailspin Spyworks

1. Beginner Developer Learning Center
http://msdn.microsoft.com/en-us/beginner/default.aspx

2. Tailspin Spyworks Step-by-Step Tutorial - demonstrates how extraordinarily simple it is to create powerful, scalable applications for the .NET platform. It shows off how to use the great new features in ASP.NET 4 to build an online store, including shopping, checkout, and administration.

This tutorial series details all of the steps taken to build the Tailspin Spyworks sample application.
http://www.asp.net/web-forms/tutorials/tailspin-spyworks-part-1

Friday, September 3, 2010

AJAX

From http://www.telerik.com/help/aspnet-ajax/ajxajax.html -

AJAX-enabled applications, on the other hand, rely on a new asynchronous method of client-server communication. It is implemented as a JavaScript engine that is loaded on the client during the initial page load. From there on, this engine serves as a mediator that sends only relevant XML-formatted data to the server and subsequently processes the server response to update the relevant page elements.

Below is a diagram of the complete lifecycle of an AJAX-enabled web form.

Click to enlargeClick to enlarge

1. Initial request by the browser – the user requests a particular URL.
2. The complete page is rendered by the server (along with the JavaScript AJAX engine) and sent to the client (HTML, CSS, JavaScript AJAX engine).
3. All subsequent requests to the server are initiated as function calls to the JavaScript engine.
4. The JavaScript engine then makes an XmlHttpRequest to the server.
5. The server processes the request and sends a response in XML format to the client (XML document). It contains the data only of the page elements that need to be changed. In most cases this data comprises just a fraction of the total page markup.
6. The AJAX engine processes the server response, updates the relevant page content or performs another operation with the new data received from the server. (HTML + CSS)

Monday, August 30, 2010

ProXPN

http://www.youtube.com/watch?v=ONpttV7o9Oc&feature=player_embedded

ProXPN is a new VPN service which creates a highly secure environment between your computer and the internet.

Thursday, July 8, 2010

Understand the Attraction of Small Functions

From http://petesbloggerama.blogspot.com/ -

Bill Wagner, in his excellent book, “Effective C#” Second Edition (which I reviewed here), gives a good example in his “Item 11 – Understand the Attraction of Small Functions”:

Bill says that one of the most common examples of premature optimization is when you create longer, more complicated methods in the hope of avoiding method calls.

The .NET Runtime performs JIT compilation on a method – by – method basis at runtime, as the methods are used. Methods that do not ever get called don’t get JITed. Bill gives a short example:

public string BuildMsg( bool takeFirstPath )
{
StringBuilder msg = new StringBuilder( );
if ( takeFirstPath )
{
msg.Append( "A problem occurred." );
msg.Append( "\nThis is a problem." );
msg.Append( "imagine much more text" );
} else
{
msg.Append( "This path is not so bad." );
msg.Append( "\nIt is only a minor inconvenience." );
msg.Append( "Add more detailed diagnostics here." );
}
return msg.ToString( );
}


The first time BuildMsg gets called, both paths are JITed, but only one is needed. But if you rewrote the method this way:

public string BuildMsg( bool takeFirstPath )
{
if ( takeFirstPath )
{
return FirstPath( );
} else
{
return SecondPath( );
}
}

-- the body of each clause has been factored into its own method, and that method can be JITed on demand rather than the first time BuildMsg is called. The example is deliberately short and contrived, but think about how you code: Do you write code with 20 or more statements in each branch? How about switch statements where the body of each case block is defined inline instead of in separate methods?

Friday, May 28, 2010

Customize VS.Net Look&Feel

http://studiostyles.info

regex to strip non-numeric characters from a phone-number-string

javascript - function(value) {return value.replace(/[^0-9]/g,"") }

This convertor function strips any non-numeric characters from the INPUT element. Now, if you enter the phone number (206) 555-9999 into the phone input field then the value 2065559999 is assigned to the phone property of the contact object

http://weblogs.asp.net/scottgu/archive/2010/05/07/jquery-templates-and-data-linking-and-microsoft-contributing-to-jquery.aspx

Sunday, March 28, 2010

Deep Zoom related

Deep Zoom - automating the generation of collection -

1. http://www.codeproject.com/KB/silverlight/DecosDeepZoom.aspx

2. http://blogs.msdn.com/giorgio/archive/2008/05/05/deep-zoom-batch-export-programmaticly-using-c.aspx

Saturday, March 27, 2010

Script.aculo.us - useful effects

Here we insered to extra parameters. In this example, the picture will start fading after 10 seconds, not frames, and will only fade to 50 percent of it's original color.
>
Here are all the 16 standard effects that you can use with script.aculo.us:

Fade: Decreases opacity
Appear: Increases opacity

BlindUp, BlindDown: Changes height of the element

SlideUp, SlideDown: Slides the element up or down.

Shrink: Resizes the element( Shrinks)
Grow: Resizes the element( Expands)

Highlight: CHanges background color of element.

Shake: Causes an element to slide left to right a few times.

Pulsate: Rapidly fades in and out several times.

DropOut: Simultaneously fades an element and moves it downward, so it appears to drop off the page

SwitchOff: SImulates an old television bieng turned off; a quick flicker, and then the element collapses into a horizontal line.

Puff: Makes an element incease in size while decreasing opacity.

Squish: Similiar to shrink, but the element's top-left corner remains fixed.

Fold: First redurces the element's height to a thin line and then reduces its width until it disappears

Saturday, March 13, 2010

QuirksMode - for all your browser quirks

QuirksMode - for all your browser quirks: "QuirksMode.org is the prime source for browser compatibility information on the Internet. It is maintained by Peter-Paul Koch, mobile platform strategist in Amsterdam, the Netherlands.

QuirksMode.org is the home of the Browser Compatibility Tables, where you’ll find hype-free assessments of the major browsers’ CSS and JavaScript capabilities, as well as their adherence to the W3C standards."

Saturday, February 13, 2010

http://www.questpond.com/

http://www.questpond.com/

Has e-books and videos on .net interview questions, projects etc

Wednesday, February 10, 2010

ASP.Net stuff to learn

6 Things Every ASP.NET Developer Should Know by 2010 -
http://blog.saviantllc.com/archive/2009/03/09/4.aspx
(read comments for other suggestions)

patterns & practices: App Arch Guide 2.0 Knowledge Base

http://www.codeplex.com/wikipage?ProjectName=AppArch&title=App%20Pattern%20-%20Three-Tier%20RIA%20Application%20Scenario

Followers

Blog Archive