Tuesday 20 April 2010

Binding List<String > or String Array to Repeater

<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<%# Container.DataItem %>
<br />
</ItemTemplate>
</asp:Repeater>

You can see that there is nothing special in the HTML source code to display Array Items in Repeater Control ItemTemplate. Instead of something like
<%# DataBinder.Eval(Container.DataItem, "Price", "{0:c}") %>
<%# Container.DataItem %>

is used to call the item from the iteration process of Repeater Control. Because here Container.DataItem itself is the item to display, not something within the Container.DataItem.

string[] arr1 = new string[] {"array item 1","array item 2", };
Repeater1.DataSource = arr1;
Repeater1.DataBind();

Thursday 15 April 2010

How to register an HTTP handler for IIS 7.0 running in Integrated Mode

#Compile the HTTP handler class and copy the resulting assembly to the Bin folder under the application's root folder.
-or-
Put the source code for the handler into the application's App_Code folder.

For an example of an HTTP handler, see Walkthrough: Creating a Synchronous HTTP Handler.

#In the application's Web.config file, create a handlers element in the system.webServer section.

Note

Handlers that are defined in the httpHandlers element are not used. If you do not remove the httpHandlers registrations, you must set the validation element’s validateIntegratedModeConfiguration attribute to false in order to avoid errors. The validation element is a child element of the system.webServer element. For more information, see "Disabling the migration error message" in ASP.NET Integration with IIS 7.0.

The following example shows how to register an HTTP handler that responds to requests for the SampleHandler.new resource. The handler is defined as the class SampleHandler in the assembly SampleHandlerAssembly.

<configuration>
<system.webServer>
<handlers>
<add name="SampleHandler" verb="*"
path="SampleHandler.new"
type="SampleHandler, SampleHandlerAssembly"
resourceType="Unspecified" />
</handlers>
<system.webServer>
</configuration>

Note

The resourceType attribute performs the same function as the Verify file exists option in IIS manager for IIS 6.0.

Read More>>

Find the Position of an Element using jQuery

$('#id').position().top;
$('#id').position().left;

Thursday 8 April 2010

A/B testing and Multivariate testing

A/B testing or bucket testing is a method of marketing testing by which a baseline control sample is compared to a variety of single-variable test samples in order to improve response rates. A classic direct mail tactic, this method has been recently adopted within the interactive space to test tactics such as banner ads, emails and landing pages.

Significant improvements can be seen through testing elements like copy text, layouts, images and colors. However, not all elements produce the same improvements, and by looking at the results from different tests, it is possible to identify those elements that consistently tend to produce the greatest improvements.

Employers of this A/B testing method will distribute multiple samples of a test, including the control, to see which single variable is most effective in increasing a response rate or other desired outcome. The test, in order to be effective, must reach an audience of a sufficient size that there is a reasonable chance of detecting a meaningful difference between the control and other tactics: see Statistical power.

This method is different to multivariate testing which applies statistical modeling which allows a tester to try multiple variables within the samples distributed.

Companies well-known for using A/B testing

Amazon.com, Google, Microsoft, Ebay, Yahoo

Multivariate testing

In statistics, multivariate testing or multi-variable testing is a technique for testing hypotheses on complex multi-variable systems, especially used in testing market perceptions.

In internet marketing, multivariate testing is a process by which more than one component of a website may be tested in a live environment. It can be thought of in simple terms as numerous A/B tests performed on one page at the same time. A/B tests are usually performed to determine the better of two content variations, multivariate testing can theoretically test the effectiveness of limitless combinations. The only limits on the number of combinations and the number of variables in a multivariate test are the amount of time it will take to get a statistically valid sample of visitors and computational power.

Multivariate testing is usually employed in order to ascertain which content or creative variation produces the best improvement in the defined goals of a website, whether that be user registrations or successful completion of a checkout process (that is, conversion rate). Dramatic increases can be seen through testing different copy text, form layouts and even landing page images and background colours. However, not all elements produce the same increase in conversions, and by looking at the results from different tests, it is possible to identify those elements that consistently tend to produce the greatest increase in conversions.

Multivariate testing is currently an area of high growth in internet marketing as it helps website owners to ensure that they are getting the most from the visitors arriving at their site. Areas such as search engine optimization and pay per click advertising bring visitors to a site and have been extensively used by many organisations but multivariate testing allows internet marketeers to ensure that visitors are being shown the right offers, content and layout to convert them to sale, registration or the desired action once they arrive at the website.

There are two principal approaches used to achieve multivariate testing on websites. One being Page Tagging; a process where the website creator inserts Javascript into the site to inject content variants and monitor visitor response. Page tagging typically tracks what a visitor viewed on the website and for how long that visitor remained on the site together with any click or conversion related actions performed. Page tagging usually needs to be done by a technical team and typically cannot be accomplished by a web marketer.[3]. Later refinements on this method allow for a single common tag to be deployed across all pages, reducing deployment time and removing the need for re-deployment between tests.

Companies known to employ a tag based method of multivariate testing are: Conversion Works, Adobe, Business Intelligence Group GmbH (B.I.G.), Amadesa, DIVOLUTION, Maxymiser, Google Website Optimizer, Vertster and Autonomy Corporation

The second principal approach used does not require page tagging. By establishing a DNS-proxy or hosting within a website's own datacenter, it is possible to intercept and process all web traffic to and from the site undergoing testing, insert variants and monitor visitor response. In this case, all logic sits server rather than browser-side and after initial DNS changes are made, no further technical involvement is required from the website point of view. SiteSpect is known to employ this method of implementation.

Multivariate testing can also be applied to email body content and mobile web pages.

A data center or datacenter (or datacentre), also called a server farm, is a facility used to house computer systems and associated components, such as telecommunications and storage systems. It generally includes redundant or backup power supplies, redundant data communications connections, environmental controls (e.g., air conditioning, fire suppression) and security devices.

Conversion rate

In internet marketing, conversion rate is the ratio of visitors who convert casual content views or website visits into desired actions based on subtle or direct requests from marketers, advertisers, and content creators. The Conversion rate is defined as follows:

Conversion rate = Number of Goal Achievements \ Visits

Successful conversions are interpreted differently by individual marketers, advertisers, and content creators. To online retailers, for example, a successful conversion may constitute the sale of a product to a consumer whose interest in the item was initially sparked by clicking a banner advertisement. To content creators, however, a successful conversion may refer to a membership registration, newsletter subscription, software download, or other activity that occurs due to a subtle or direct request from the content creator for the visitor to take the action.


Internet marketing, also referred to as i-marketing, web-marketing, online-marketing, Search Engine Marketing (SEM) or e-Marketing, is the marketing of products or services over the Internet.

CSS position Property

Default value: static
Inherited: no
Version: CSS2
JavaScript syntax: object.style.position="absolute"

absolute

Generates an absolutely positioned element, positioned relative to the first parent element that has a position other than static. The element's position is specified with the "left", "top", "right", and "bottom" properties

fixed

Generates an absolutely positioned element, positioned relative to the browser window. The element's position is specified with the "left", "top", "right", and "bottom" properties

relative

Generates a relatively positioned element, positioned relative to its normal position, so "left:20" adds 20 pixels to the element's LEFT position

static

Default. No position, the element occurs in the normal flow (ignores any top, bottom, left, right, or z-index declarations)

inherit

Specifies that the value of the position property should be inherited from the parent element

Thursday 1 April 2010

JavaScript to remove newline characters from a string

Using a regular expression


function removeNL(s){
return s.replace(/[\n\r\t]/g, ""); //replaces NewLine or CarriageReturn or Tab with empty string.
}


Call

s.replace(/[\n]/g, "");

to remove all newline characters.


////////////////////////

function removeNL(s) {
/*
** Remove NewLine, CarriageReturn and Tab characters from a String
** s string to be processed
** returns new string
*/
r = "";
for (i=0; i < s.length; i++) {
if (s.charAt(i) != '\n' &&
s.charAt(i) != '\r' &&
s.charAt(i) != '\t') {
r += s.charAt(i);
}
}
return r;
}