Yearly Archives - 2012

How to use SQL Membership Provider in ASP.NET

The ASP.NET membership feature provides secure credential storage for application users. We will use the following: Web Page Named Login.aspx and another Web Page named CreateUser.aspxLogin Control.Create User Wizard Control. Steps: 1- Configure Forms Authentication in Web.config File To configure forms authentication, set the <authentication> element's mode attribute to "Forms" and then configure your application's Web.config file as shown...

How to connect to Team Foundation Server (TFS) using C#.NET

I will show you how to connect to Team Foundation Server (TFS) and add work item via code.First you must install TFS SDK, you can download Team Foundation Server SDK from the below link:http://www.microsoft.com/downloads/details.aspx?FamilyID=7e0fdd66-698a-4e6a-b373-bd0642847ab7&DisplayLang=en Steps:1- Create windows or web Application2- Add References for :Microsoft.TeamFoundation.ClientMicrosoft.TeamFoundation.WorkItemTracking.Client3- The below code will help you to work with Team Foundation...

How to allow paging in Repeater control in ASP.NET

I'll show you how to make a repeater that allow paging, also I'll make it as a web user control so anyone can just use it right away. Steps: 1- Create a web user control using C# and rename it to RepeaterPager. 2- Add four buttons and one label:Control Name Text Button btnNext >Button btnPrevious <Button btnLastRecord >>Button...

Custom validator scrolls page to the top in ASP.NET

If we add a ValidationSummary control to the page, its ValidationSummaryOnSubmit function invokes “window.scrollTo(0,0)” when page is invalid. That’s why the page scrolls to the top. To workaround this issue, we can assign a function to window.scrollTo which do nothing, so that window.scrollTo(0,0) will not take effect. This workaround is appropriate for the pages which...

How to sort a whole XML document using XSL

This is a variation of an identity transformation that sorts all nodes and attributes alphabetically. <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"> <xsl:output method="xml" omit-xml-declaration="no"> <xsl:template match="@*|node()" priority="1"> <xsl:copy> <xsl:apply-templates select="@*|node()"> <xsl:sort data-type="text" order="ascending" select="name()"> </xsl:sort></xsl:apply-templates> </xsl:copy></xsl:template> </xsl:output></xsl:output></xsl:stylesheet>

How to get the value of textbox which is created at runtime in WPF

I will show you how to add Controls at runtime and get their values in WPF. 1- Create WPF Application.2- Add Button to add textbox at runtime.3- Add Button to read value from textbox Which is Created at Runtime.4- Add Stackpanel to Host Controls on it. the following method Responsible for Add Controls at runtime: private void...