Archive for the ‘Visual Studio’ Category

LinkButton ,Label inside Repeater – ASP.NET

Hello All Today I will show you how to fire  Link Button’s event with argument and initialize a label inside of a repeater. To do that first we have to take LinkButton and a Label control inside the ItemTemplate of the repeater. Then we have to initialize the the Label from OnItemDataBound event of the repeater. In the following code blocks its shown how to perform the job. Following is my Default.aspx file: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"...

Creating WCF Service

Hello all Today I will try to demonstrate how to create simple web service through WCF. To get into WCF first we have to know some basic principal of WCF and its "ABC". Address : the location of the service. Bind: how to get service. Contract: service action. In this tutorial I will not describe details about WCF.My basic focus will be on creating a WCF service through Visual Studio 2008 First open a new WCF project: In my sample project I have named "TestWCFService"...

Isolated Unit Test of Business Logic With NMock in TDD

Hello All In test driven development its always needed to test a particular project tested with make it isolate ( test with removing dependency from other projects ), In this scenario we virtually create the input set which will be produced from other projects(class,methods etc) and test whether our testable methods are functioning with that input set or not. To do that we have to make mock of the dependent objects. In the example bellow I have shown how to test a business...

UI test with WatiN for TDD in .NET

Hello all Today I will show how to test UI ( User Interfaces ) in .NET with WatiN . WatiN is UI test framework. Though its a very simple but i have felt the documentation is not rich enough with example. So i have taken an initiative to make it more userfriendly for the developers. I will not emphasize on how to configure WatiN as its already well documented in the following links. What i will try to do is make familiar with HTML controls that’s needed to be validated...

ASP.NET Form Authentication

Hello All Today I will demonstrate how to do Form based authentication manually.Though it can be maintained through login controls which is provided by Visual Studio but sometime we need to do the task without using those controls and the required database. First we have to perform validation for the user, then we needed to authenticate the user for different type of task according to the role of the user ( I will do role based authentication.) In my example I have...

Web service creation & consuming with ASP.NET

Hello all Today I will show how to create web service with VS2008 and consume it in different application. first I have opened a web service from File>New web site > web service named "DemoWebService". now in the solution explorer we can a Service.asmx file and the Service.cs file in App_Code . I have added another web service named WebServiceTest.asmx so a WebServiceTest.cs file also added in App_Code folder. we will basically work with *.cs...

Captcha generate with ASP.NET & C#

Hello all Today I will demonstrate how to generate captcha with asp.net & C# . though there are many .NET plugin and controls to serve the purpose but my focus is to generate the a random image and its manipulation with the help of .NET framework. First open a web project and add a "Web user control" , in the example the name of my control is "ImageGeneratorControl.ascx" . the purpose of the control is to generate a image according to the random...

Simple unit test with NUnit

Hello all Today I will show you how to do unit test of a .NET project with NUnit. NUnit is a great tool to do unit test of any .NET project.As its a third party tool so you have to download it from here . I assume that you all are familiar with unit test.For the simplicity I will show you a simple example,Once when you are habituated with this took you will find yourself in many complex test script. first I opened an new class project named Calculation.Core. then I added...

Simple Web Application Installer with VS2008

Hello all. Today I will show how simple it is to make a web application installer with Visual Studio. I have assumed that you have a project already open and now you want to make a installer for it. First we have to add a new project from File->Add->New Project Then we have to select Other Project Type->Setup & Deploy -> web setup project I name it “WebSetupProject” . In Solution Explorer we will found that installer project. Now...

Simple .NET Cookie Management

Hello all Today I will give a short description about using Cookie with .NET , Cookie is one of the most impotent thing to maintain scalability of server as well as manipulation user’s information easier. Generally a Cookie enabled browser can store about 20 cookies for a single domain , so what’s happen ;when you try to keep more cookie in a browser for a particular domain it discard the oldest cookie. If you don’t set the expiration of a Cooke it...
Page 1 of 1712345NextLast »