Posts

Showing posts from January, 2015

Multi Selection in ListBox and Adding One ListBox to another Listbox in Asp.net c#

  Aspx Page    <asp:ListBox ID="listboxEducation" runat="server" SelectionMode="Multiple" Height="150">     </asp:ListBox>    <asp:ImageButton ID="imgAdd" ImageUrl="~/Hospital/icons/rightArrow.png" Height="25"       Width="25" runat="server" OnClick="imgAdd_Click" />        <asp:ImageButton ID="imgRemove" ImageUrl="~/Hospital/icons/leftArrow.png" Height="25"              Width="25" runat="server" onclick="imgRemove_Click"/>         <asp:ListBox ID="listboxEducationSelected" runat="server" SelectionMode="Multiple"                 Height="150"></asp:ListBox> .cs page c#.   protected void imgAdd_Click(object sender, ImageClickEventArgs e)       ...
Image
Heaps Heaps are based on the notion of a complete tree , for which we gave an informal definition earlier. Formally: A binary tree is completely full if it is of height, h , and has 2 h +1 -1 nodes. A binary tree of height, h , is complete iff it is empty or its left subtree is complete of height h -1 and its right subtree is completely full of height h -2 or its left subtree is completely full of height h -1 and its right subtree is complete of height h -1. A complete tree is filled from the left: all the leaves are on the same level or two adjacent ones and all nodes at the lowest level are as far to the left as possible. Heaps A binary tree has the heap property iff it is empty or the key in the root is larger than that in either child and both subtrees have the heap property. A heap can be used as a priority queue: the highest priority item is at the root and is trivially extracted. But if the root is deleted, we are left with...

Difference between Asp.net SessionState and ViewState in C#, VB.NET

Introduction : Description :       View State :  - View state is maintained in page level only. - View state of one page is not visible in another page. - View state information stored in client only. - View state persist the values of particular page in the client (browser) when post back operation done. - View state used to persist page-instance-specific data.       Session State :  - Session state is maintained in session level. - Session state value is available in all pages within a user session. - Session state information stored in server. - Session state persist the data of particular user in the server. This data available till user close the browser or session time completes. - Session state used to persist the user-specific data on the server side.       Us age - If you want to access the information on different web pages, you can use SessionState -...
Stack vs Heap So far we have seen how to declare basic type variables such as int , double , etc, and complex types such as arrays and structs. The way we have been declaring them so far, with a syntax that is like other languages such as MATLAB, Python, etc, puts these variables on the stack in C. The Stack What is the stack? It's a special region of your computer's memory that stores temporary variables created by each function (including the main() function). The stack is a "FILO" (first in, last out) data structure, that is managed and optimized by the CPU quite closely. Every time a function declares a new variable, it is "pushed" onto the stack. Then every time a function exits, all of the variables pushed onto the stack by that function, are freed (that is to say, they are deleted). Once a stack variable is freed, that region of memory becomes available for other stack variables. The advantage of using the stack to store variable...

What are Value Types and Reference Types in .Net

  A ccording to MSDN,   A data type is a value type if it holds the data within its own memory allocation. A reference type contains a pointer to another memory location that holds the data. All the data types in .net are classified in to value types and reference types.  The data types whose values are directly stored in stack memory area are called as value types and the data types whose values are stored in heap memory area and its address is stored in a variable in stack memory area are called as reference types. Among all built in data types of .net string and object are reference type and all other data types are value types . Among user defined data types, class, interface, delegate and arrays are reference type while structure and enumeration are value type. Value Types ---------------- Value types include the following: All numeric data types Boolean, Char, and Date All structures, eve...

Polymorphism in C#.NET

According to MSDN , Through inheritance, a class can be used as more than one type; it can be used as its own type, any base types, or any interface type if it implements interfaces. This is called polymorphism.   In C#, every type is polymorphic. Types can be used as their own type or as a Object instance, because any type automatically treats Object as a base type. Polymorphism means having more than one form. Overloading and overriding are used to implement polymorphism. Polymorphism is classified into compile time polymorphism or early binding or static binding and Runtime polymorphism or late binding or dynamic binding. Polymorphism Examples Method Overloading Method Overriding Compile time Polymorphism or Early Binding The polymorphism in which compiler identifies which polymorphic form it has to execute at compile time it self is called as compile time polymorphism or early binding.   Advantage of early binding is execution will ...

Sign Up with Facebook in asp.net website

    <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.2.min.js"></script>     <script type="text/javascript" src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script type="text/javascript">         // Load the SDK Asynchronously         (function (d) {             var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];             if (d.getElementById(id)) { return; }             js = d.createElement('script'); js.id = id; js.async = true;             js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";             ref.par...