Saturday, 19 July 2014

how to Work with TabContainer in ajax toolkit


Aspx.cs Code for Tab Container
<div>
       
        <asp:UpdatePanel ID="tupdata"runat="server">
       
          <ContentTemplate>
           
          </ContentTemplate>
        </asp:UpdatePanel>
       
        <asp:TabContainer ID="TabContainer1"  runat="server" ActiveTabIndex="0"
            Width="707px">
            <asp:TabPanel HeaderText="Registration"runat="server"ID="tb1">
                <ContentTemplate>
                <asp:TabContainer ID="tbc2" runat="server">
                  <asp:TabPanel runat="server"ID="t">
                  <ContentTemplate>
                    <table>
                        <tr>
                            <td>
                                First Name
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="txtfirstname"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Last Name
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="txtlast"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Password
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="txtpassword" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ReEnter-Password
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="txtrepassword"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Email ID
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="txtemail"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                phoneNo
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="txtphoneno"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Location
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="txtloc" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                                <asp:Button ID="btnreset"runat="server"Text="Cancel"/>
                            </td>
                        </tr>
                    </table>
                    </ContentTemplate>
                  </asp:TabPanel>
                  <asp:TabPanel runat="server"ID="TabPanel2">
                  <ContentTemplate>
                    <table>
                        <tr>
                            <td>
                                First Name
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox15"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Last Name
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox16"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                               <span style="background-color:red">Password</span>
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox17"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ReEnter-Password
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox18"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Email ID
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox19"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                phoneNo
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox20"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Location
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox21"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                                <asp:Button ID="Button3"runat="server"Text="Cancel"/>
                            </td>
                        </tr>
                    </table>
                    </ContentTemplate>
                  </asp:TabPanel>
                </asp:TabContainer>
                   
                </ContentTemplate>
            </asp:TabPanel>
            <asp:TabPanel HeaderText="Login"ID="tb2"runat="server">
                <ContentTemplate>
                    <table>
                        <tr>
                            <td>
                                First Name
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox1"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Last Name
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox2"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Password
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox3"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ReEnter-Password
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox4"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Email ID
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox5"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                phoneNo
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox6"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Location
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox7"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                                <asp:Button ID="Button1"runat="server"Text="Cancel"/>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:TabPanel>
            <asp:TabPanel HeaderText="Home"ID="TabPanel1"runat="server">
                <ContentTemplate>
                    <table>
                        <tr>
                            <td>
                                First Name
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox8"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Last Name
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox9"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Password
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox10"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ReEnter-Password
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox11"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Email ID
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox12"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                phoneNo
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox13"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Location
                            </td>
                            <td>
                                :
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox14"runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                                <asp:Button ID="Button2"runat="server"Text="Cancel"/>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:TabPanel>
        </asp:TabContainer>
    </div>


Friday, 11 July 2014

What are the different coding standards used in c# projects

There are 3 types of naming convention pascal,hungarian and Camel.



Pascal notation starts with all first letter of the word capital. For example

"Customercode" where you can see "C" letter capital in both the words.



Camel notation starts with all first letter capital except the first letter of 
the first word. For example "customerCode", you can see the first letter "c" 
small and the other "C" of the letter code capital.



Hungarian notation starts with first word as the datatype prefix. For instance "intCount","boolIsValie" 
etc. The first word describes the datatype lik int, bool etc.




Wednesday, 9 July 2014

How to read Xml File Using gridview in asp.net

How to read Xml File Using gridview in asp.net



source Of xml file
<?xml version="1.0" encoding="utf-8" ?>
<EmployeeInformation>

  <Employee>

    <sno>101</sno>

    <firstname>Pankaj </firstname>
      <lastname>Lohani</lastname>
      <address>hyderbad</address>

  </Employee>

  <Employee>

    <sno>102</sno>

    <firstname>sharath </firstname>
      <lastname>Lohani</lastname>
      <address>goa</address>

  </Employee>

  <Employee>

    <sno>103</sno>

    <firstname>rakesh </firstname>
      <lastname>Lohani</lastname>
      <address>delhi</address>

  </Employee>
  <Employee>
    <sno>105</sno>

    <firstname>rakkaj </firstname>
      <lastname>shiva</lastname>
      <address>hyderbad</address>

  </Employee>


</EmployeeInformation>


ASpx.page (Design view):
------------------------
    <asp:GridView ID="grddata1" runat="server">
    
    


    </asp:GridView>

Aspx.cs (code View File)


   protected voidPage_Load(object sender, EventArgs e)
    {

        var xmlfilepath = Server.MapPath("mydata.xml");
        DataSet dsemp = newDataSet();
        dsemp.ReadXml(xmlfilepath);
        grddata1.DataSource = dsemp.Tables[0].DefaultView;
        grddata1.DataBind();

    }





what is Inheritance in C#

Inheritance

Acquiring the properties of an existing class into a new class by establishing a parent–child relationship between classes is known as Inheritance.

The big advantage of inheritance is reusability of code:



  • using System;  
  • using System.Collections.Generic;  
  • using System.Linq;  
  • using System.Text;  
  • using System.Threading.Tasks;  
  •   
  • namespace InheritanceDemo  
  • {  
  •     class Parent  
  •     {  
  •         public void ParentMethod()  
  •         {  
  •             Console.WriteLine("this is parent method");  
  •         }  
  •     }  
  •     class child :Parent  
  •     {   
  •         public void childmethod()  
  •         {  
  •             Console.WriteLine("this is child method");  
  •         }  
  •         static void Main(string[] args)  
  •         {        
  •             child obj = new child();                            
  •             obj.childmethod();  
  •             obj.ParentMethod();  
  •             Console.ReadKey();  
  •         }  
  •     }  
  • }  
  • how to add image in Title bar

    Introduction

    This article shows how to add an image to the title bar of your website.
    Step:1
    create simple aspx page







    Step:2
    create icon that should be display in  title bar


    add icon to the  to the solution explore 
    Then write link in head section to display the icon in the title bar
     <link rel="Shortcut Icon" href="sky.jpg" />

    Output Of the Task