Friday, March 20, 2009
Wednesday, March 11, 2009
WCF Tutorial
- A - Address
- B - Binding
- C – Contract
You can find some sample applications in some of my articles. Samples consist of a WCF service and a silverlight client that consumes the service. You'll get a basic concept of WCF from those samples.
Download Sample Application,
Tuesday, March 10, 2009
Remove Binding in WPF code-behind
We can remove binding from a dependency property of a dependency object from code behind using,
BindingOperations.ClearBinding(sliderRange, Slider.ValueProperty);In this snippet, we are removing binding from Value Property of Slider sliderRange.
Monday, March 2, 2009
Tag Mapping in ASP.NET
Tag mapping is using for mapping two controls of compatible type so that it'll map to the mapped control.Suppose we are creating a custom panel having some custom functionality like,
public class CustomPanel : PanelNow we can map all panels to our custom panel so that normal panel will get functionality of custom panel.In web.config,
{
//Code here//
}
<pages>
<tagMapping>
<clear />
<add tagType="System.Web.UI.WebControls.Panel"
mappedTagType="CustomPanel"/>
</tagMapping>
</pages>
Sunday, March 1, 2009
Image & Sound in Validator Controls
I am going to give code snippets for a very interesting trick.ie,to display image or sound instead of validation message in ASP.NET Validation controls.
Displaying image
<asp:requiredfieldvalidator id="reqPercentage" runat="server" errormessage='<img src="image.gif">' controltovalidate="txtPercentage">
</asp:requiredfieldvalidator>
for displaying image instead of text we are giving an img tag with src set to a image in our application.so when validation is failed it'll show image instead of text.
Sound in Validation Control
<asp:requiredfieldvalidator id="reqPercentage" runat="server"
errormessage='<bgsound src="sound.wav">' controltovalidate="txtPercentage">
</asp:requiredfieldvalidator>
And also disable client side script for textbox.Run the application yo'll see the change.