Wednesday, March 31, 2010

Cross-Site Access Policy for Self-Hosted WCF Services

Ref: http://www.markusegger.com/blog/Development.aspx?messageid=99f2b8b5-bbd0-4ca4-988a-cc2701d719c3

Exposing 2 EndPoints for same WCF service using different Bindings

ref: http://joymonscode.blogspot.com/2009/05/exposing-2-endpoints-for-same-wcf.html

Tuesday, March 30, 2010

Events and Delegates

Ref: http://www.akadia.com/services/dotnet_delegates_and_events.html

Silverlight videos

Creating and calling a WCF and webservice

navigation-framework

jQuery

Ref: http://www.w3schools.com/jquery/default.asp

Ref2 : http://msdn.microsoft.com/en-us/magazine/dd453033.aspx

jQuery Syntax

The jQuery syntax is tailor made for selecting HTML elements and perform some action on the element(s).

Basic syntax is: $(selector).action()

  • A dollar sign to define jQuery
  • A (selector) to "query (or find)" HTML elements
  • An jQuery action() to be performed upon the element(s)
In HTML DOM terms:

Selectors allow you to manipulate DOM elements as a group or as a single node.

jQuery Syntax Examples

$(this).hide()
Demonstrates the jQuery hide() function, hiding the current HTML element.

$("#test").hide()
Demonstrates the jQuery hide() function, hiding the element with id="test".

$("p").hide()
Demonstrates the jQuery hide() function, hiding all

elements.

$(".test").hide()
Demonstrates the jQuery hide() function, hiding all elements with class="test".

The Document Ready Function

You might have noticed that all jQuery functions, in our examples, are inside a document ready function:

$(document).ready(function(){

--- jQuery functions go here ----

});

This is to prevent any jQuery code from running before the document is fully loaded (is ready).

jQuery Selection

jQuery Element Selectors

jQuery uses CSS style selectors to select HTML elements.

$("p") selects all

elements

$("p.intro") selects all

elements with class="intro".

$("p#demo") selects the

element with id="demo".

jQuery Attribute Selectors

jQuery uses XPath style selectors to select elements with given attributes.

$("[href]") select all elements with an href attribute.

$("[href='#']") select all elements with an href value="#".

$("[href!='#']") select all elements with an href attribute<>"#".

$("[href$='.jpg']") select all elements with an href attribute containing ".jpg".

jQuery CSS Selectors

jQuery CSS selectors can be used to change CSS properties for HTML elements.

$("p.intro").css("background-color","yellow");

jQuery Reference - Selectors


ref: http://www.w3schools.com/jquery/jquery_ref_selectors.asp

jQuery Reference - Effects

ref: http://www.w3schools.com/jquery/jquery_ref_effects.asp

jQuery Callback Functions

$("button").click(function(){
$("p").hide(1000,my_alert);
});
function my_alert()
{
alert("The paragraph is now hidden");
}

Friday, March 26, 2010

Convert Html code to displayable text

http://www.felgall.com/htmlt47.htm

CacheManager dll to control the Caching on ASP.NET

CacheManager.v1.0.60115.01 Download

Ref: http://aspalliance.com/

Copy AspAlliance.CacheManager.dll to your application's /bin folder.
Modify your web.config to include an section with the following element:


<httphandlers>

<add verb="*" path="CacheManager.axd" type="AspAlliance.CacheManager.CacheManagerPageFactory,AspAlliance.CacheManager">

</httphandlers>



refer through http://localhost/cachemanager.axd

NOTE:
1. If we dont need Viewstate for large gridviews disable it. It will give lot performance again. and enabling Caching (1sec) for the page gives is awesome and not always.
2. Make use of cache profile in Outputcache while declaring it from the web.config file.
3. sqldependency on the database to enhance caching ways. sqldependency is imposed on the tables so that when ever there is update happening on the table its will directly show on the web page even though caching set to take from the system cache. This can be done using aspnet_resql.

3.

Advanced .NET Videos

http://www.dnrtv.com/archives.aspx

http://www.dotnetrocks.com/

Encoding and Decoding using MD5 Alg

Encoding ascii = Encoding.ASCII;
Byte[] originalBytes;
Byte[] encodedBytes;
MD5 md5 = new MD5CryptoServiceProvider();
originalBytes = ascii.GetBytes(TextBox1.Text);
encodedBytes = md5.ComputeHash(originalBytes);
lblMD5.Text = ascii.GetString(encodedBytes);

Namepaces required
System.Text
System.Security.Cryptography
System.Data;

Test Driven Development Using NUnit in C#

Ref: http://aspnet.4guysfromrolla.com/articles/011905-1.aspx

Visual Studio shortcuts

Ref: http://www.dofactory.com/ShortCutKeys/ShortCutKeys.aspx

Thursday, March 25, 2010

Serialization in .NET

Ref: http://aspalliance.com/983_Introducing_Serialization_in_NET.all

Def: Serialization is a process of converting an object into a stream of data so that it can be is easily transmittable over the network or can be continued in a persistent storage location. (or)
Serialization is the process of saving the state of an object in a persistent storage media by converting the object to a linear stream of bytes.

Serialization in .NET is provided by the System.Runtime.Serialization namespace.

The Serializable Attribute


In order for a class to be serializable, it must have the attribute SerializableAttribute set and all its members must also be serializable, except if they are ignored with the attribute NonSerializedAttribute. However, the private and public members of a class are always serialized by default. The SerializationAttribute is only used for the binary serialization.

Types of Serialization

·
Binary Serialization

· SOAP Serialization

· XML Serialization

· Custom Serialization




Tuesday, March 23, 2010

SSIS Tutorials

it's the solution for automating SQL Server.
SSIS provides a way to build packages made up of tasks that can move data around from place to place and alter it on the way.

Creating a Package using
BIDS

  • Connections to data sources.
  • Data flows, which include the sources and destinations that extract and load data, the transformations that modify and extend data, and the paths that link sources, transformations, and destinations.
  • Control flows, which include tasks and containers that execute when the package runs. You can organize tasks in sequences and in loops.
  • Event handlers, which are workflows that runs in response to the events raised by a package, task, or container.
SSIS uses connection managers to integrate different data sources into packages.

connection manager depends on what type of data sources we are dealing with.
for connecting ADO record set we have to use ADO connection manager
ADO.NET data source we have to use ADO.NET connection manager.

The Control Flow tab of the Package Designer is where you tell SSIS what the package will do.

Ref: http://www.accelebrate.com/sql_training/ssis_tutorial.htm

JSON.NET

Monday, March 22, 2010

Declarative Programming

Declarative programming is when we use XML to create the Config files and based on these configuration web pages displayed and any changes can be made on this XML file (config file) to change the settings.

All WCF Contracts

Service Contract
  • Operation Contracts
Data Contract
  • DataMembers
Message Contracts

Fault Contracts

Enum Member

Difference between SOAP (Web Service) and REST Protocols

1.REST has no WSDL interface definition

2. REST is over HTTP, but SOAP can be over any transport protocols such HTTP, FTP, STMP, JMS etc.

3. SOAP is a protocol for sending/receiving data over HTTP as XML. It uses soap envelope over XML , but REST is just XML.

REST(HTTP GET) keeps the state and SOAP is a stateless.
REST is asynchronous.

Business Entity or Object

  • A business object is an object that represents a real-world entity such as a person, place, or
  • business process.
  • Business objects bring together both the characteristics and behavior of a particular entity.
  • One of the primary jobs of a business object is to enforce business rules. Business rules fall
    into two broad categories:
1. Data integrity rules – This encompasses rules that enforce things such as required
fields, field lengths, ranges, and so on.
2. Domain rules – This refers to high-level business rules such as “You can’t create an
invoice for a client who is over their credit limit”.
  • Business objects are created as a separate layer as a dll and will be available across UI, Business layer and Data access layer.
  • Now more adv... Business objects are made available using WCF services instead of dll. so that all the projects would be same page...