Posts

solution of error 403

 <system.webServer> <defaultDocument> <files> <add value="WebForm2.aspx" /> </files> </defaultDocument> <directoryBrowse enabled="false" /> </system.webServer> paste this code in web.config file under <configuration>

WCF service

  1)create new project WFC service library 2)change type from to string in !service1 and service1 3)add new project to solution as Console Application 4)add reference to console application of wcf class library 5)add this code to console application  using (ServiceHost host = new ServiceHost(typeof(Conservice.Program)))             {                 host.Open();                 Console.WriteLine("Host Started @" +DateTime.Now.ToString());                 Console.ReadLine();             } 6)add this code to app.config file of conservice <system.serviceModel> <services> <service name="Conservice.Conservice" behaviorConfiguration="mexbehaviour"> <endpoint address="Conservice" binding="basicHttpBinding" contract="Conservice.IConService"></endpoint> <end...

Assemblies and using them in console app

  1) create a class library project (i.e our assembly) 2) add this code to the class automatically created to the .cs file (i.e Class1.cs) public int addition(int fn,int sn)         {             return fn + sn;         }         public int subtraction(int fn, int sn)         {             return fn - sn;         } 3)add a console application to the solution also add reference of class library to the project. 4)add this code to the main method of the .cs file (i.e Program.cs) using assembly (cuz 'assembly' is my class library name) Class1 obj = new Class1();             int v1 = obj.addition(10,20);                          Console.WriteLine(v1);             Console.ReadLine();       ...

Web Service

  1) create asp.net web application  project and add webservice into the project 2) add this code to asmx.cs file of class library public int add(int a, int b)         {             return a + b;         } 3)run and test it 4)add  asp.net web application  project to your solution 5)add reference of service to  asp.net web application 6)add this code to aspx file <table>                 <tr>                     <td>Enter Number 1</td>                     <td>                         <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>                 </tr>            ...

Calculator(wpf)

   <Window x:Class="WpfApp1_Calculator_.Window1"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"         xmlns:local="clr-namespace:WpfApp1_Calculator_"         mc:Ignorable="d"         Title="Window1" Height="720" Width="1280">     <Grid OpacityMask="#FFB43E3E" Background="Black">         <Grid.RowDefinitions>             <RowDefinition Height="269*"/>             <RowDefinition Height="61*"/>             <RowDefinition Height="104*"/>     ...

AD Rotator

  <Advertisements>   <Ad>     <ImageUrl>~/Images/google.png</ImageUrl>     <NavigateUrl>https://www.google.com/</NavigateUrl>     <AlternateText>Please visit on your google page http://www.google.com </AlternateText>     <Impressions>2</Impressions>     <Keyword>Google</Keyword>   </Ad>   <Ad>     <ImageUrl>~/Images/w3schools.png</ImageUrl>     <NavigateUrl>https://www.w3schools.com/</NavigateUrl>     <AlternateText>Please visit the websit of w3schools http://www.w3schools.com </AlternateText>     <Impressions>5</Impressions>     <Keyword>w3schools</Keyword>   </Ad>   <Ad>     <ImageUrl>~/Images/codeproject.png</ImageUrl>     <NavigateUrl>https://www.codeproject.com/...