-->

Saturday, May 25, 2013

Computer Programming : How to use RoundedCornerExtender in ASP.NET with Example

Computer Programming: As the name suggest , RoundedCornerExtender attaches and makes the corners of any ASP.NET controls round . It adds a background panel to any ASP.NET control so that the control appears with rounded corners. The overall height of the original control changes slightly . RoundedCornersExtender has only three important properties such as:

TargetControlId : Set the ID of the control whose corners are to be modified .

Radius : Set the Radius of the control corners . By default the value is 5 pixel.

Corners : Set the corners of the target control , which you want to round.

Before copy this code please add ajax ControlToolkit to your website/project

Lets Take an Example



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Roundcorneraspx.aspx.cs" Inherits="Roundcorneraspx" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div>
<asp:Panel ID="Panel1" runat="server" Width="300px" Height ="200px">


This is my panel control

visit : http://dotprogramming.blogspot.com

 

 
 
</asp:Panel>
<asp:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID ="Panel1" Radius ="10" Corners ="All" BorderColor ="SkyBlue" Color ="Black">


 
 
</asp:RoundedCornersExtender>
</div>
</form>
</body>
</html>

OutPut

Friday, May 24, 2013

Intranet system project in ASP.NET


What is the mean of Intranet here: "group of computer share information between student and faculty"
This web application is developed to provide the facilities to various users. In this developed application there are three main users, which have the different privileges. These users can perform the various operations through this application.

Ø Administrator

Administer can add new faculty.

Administer can add new faculty member.
Administer can provide username and password to faculty member to change their accounts.



Administer can delete the existing faculty account.


Administer can edit the existing faculty account.


Administer can chat with other faculty members.


Ø

ØFaculty

Faculty can edit its account.

Faculty can upload the documents to give the students.

Faculty can chat with administer or other faculty member.

Faculty can view their profile.
ØUser
User can view the particular faculty member profile.
User can view the particular faculty member list.
User can download the files from the respective faulty member’s profile.
Intranet system project in ASP.NET-home screen

Users contact with faculty members by provided their contacts.


Snapshot of the Project:

Login Form :
Admin Functionality:

Intranet system project in ASP.NET

Thursday, May 23, 2013

Create Databases using EntityFramework 5 in C# programming

Entity Framework is an open source object-relational (ORM) framework for ADO.NET. It allows user to create a model by writing code in EF designer. The releases are improving from entity framework 3.5 and onwards. Entity Framework 5 is the stable version for visual studio 2010 and 2012 and updated soon with the latest features.

The main advantages of using Entity Framework 5 are:
  • Speed - You do not have to worry about creating a DB you just start coding. Good for developers coming from a programming background without much DBA experience.
  • Simple - you do not have a edmx model to update or maintain.
Entity framework 5 released with some advanced features like enum support, table-valued functions and performance improvements. In this article we will create a database using entity framework 5 code first approach.

Steps of Creating Database through Entity Framework
  • Create a Project ClassLibrary in Visual Studio.
  • Install EntityFramework from Package Manager Console (required internet connection) using
    • PM> install-package entityframework 
  • Remove InBuilt Class i.e "Class1".
  • Add a new class “Student”.
  • Add another class DataContext (Name may be change) inherited by DbContext
    • DbContext is in System.Data.Entity Namespace.
  • Write the below code in DataContext class 
j
public DataContext()
          :base("Database Name")
{
    if(!Database.Exists("Database Name"))
        Database.SetInitializer(new DropCreateDatabaseAlways<DataContext>());
}
public DbSet<Student> Student { get; set; }

  •  Add a new project2 (Window Form Application) that will be used to execute constructor of DataContext class.
  • Install Entity Framework 5 in this new project also.
  • Create an object of DataContext class in Form1 Constructor.
  • Now run project2 and your Database has been created.
When we will execute the given command to install entity framework, it will execute the stable version i.e. entity framework 5.

Download code file

Insert foreign key in database

Wednesday, May 22, 2013

Computer Programming : How to use DropShadowExtender in AJAX with Example

DropShadowExtender enables you to add a drop shadow to an ASP.NET panel control . Using this extender , you can specify the width and opacity of the drop shadow as well  as make the corners of the panel rounded to give the panel looks more attractive and professional .

Lets take an Example

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="dropshadow.aspx.cs" Inherits="dropshadow" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:Panel ID="Panel1" runat="server" Width="269px">
            <asp:Login ID="Login1" runat="server"></asp:Login>
        </asp:Panel>
        <asp:DropShadowExtender ID="DropShadowExtender1" runat="server" TargetControlID ="Panel1" Opacity ="0.7" Rounded ="true" ></asp:DropShadowExtender>
    </div>
    </form>
</body>

</html>

OutPut:





Properties of DropShadowExtender

TargetControlID : Set the ID of the control or link on which you want to apply the DropShadow effect.

Width : Sets the width of the drop shadow . The default value for the width of the shadow in 5 pixels.

Opacity : Sets the opaqueness of the drop shadow . The value of the drop shadow opaqueness ranges from 0 to 1.0 . The default value for Opacity is 0.5.

TrackPosition : Sets the value to true if you want to track the position of the control to which this extender is attached.

Rounded : Sets the value to True if you want to make the corners of the drop shadow rounded.


Tuesday, May 21, 2013

How to use UpdatePanelAnimationExtender in AJAX

UpdatePanelAnimationExtender enables you to display animation while the UpdatePanel  Control is performing an asynchronous postback . This extender applies animation to a very specific situation -- Where custom events need handling before and after an updatable region is refreshed . Therefore , this extender can be used only when the web page consists of an UpdatePanel control , UpdatePanelAnimationExtender has only three important properties.

Properties of UpdatePanelAnimationExtender

TargetControlID : Sets the ID of the UpdatePanel control whose updates results in animation effects.

OnUpdating : Set an event to play animation when the update is in progress.

OnUpdated : Sets an event to play the animation when the update is complete . The animation play if and only if there is some changes is the UpdatePanel control after the update.



 

How to Use AnimationExtender in AJAX

AnimationExtender allows you to utilize built-in animation framework with existing web pages in a more declarative way. This allow you to add a broad set of fancy animation effect to your website . Using AnimationExtender , The animation plays when certain event occurs on the target control , such as OnLoad , OnClick , OnMouseOver, and OnMouseOut. You can implement and control a variety of animated action using the built-in framework , such as resizing , fading , and moving a control.
lets take an Example

Copy this code and paste your web form ( Before copy you must add ajax control tool kit to your project )

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Animation.aspx.cs" Inherits="Animation" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<div>

<asp:Button ID="Button1" runat="server" Text="Button" />

<asp:AnimationExtender ID="AnimationExtender1" runat="server" TargetControlID ="Button1">

<Animations >

<OnMouseOver>

<Color Duration="2" StartValue="#ffffff" EndValue="#000000" Property="style" PropertyKey="background-color" />
 </OnMouseOver>

<OnMouseOut>

<Color Duration="2" StartValue="#000000" EndValue="#ffffff" Property="style" PropertyKey="background-color" />

</OnMouseOut>



 
</Animations>



 
</asp:AnimationExtender>

</div>

</form>

</body>

</html>


OutPut of the code are:




Properties of AnimationExtender Control :

TargetControlID : Set the ID of the control whose event are fired to create animation effect.

OnLoad : Set an event to play the animation when the page is loaded.

OnMouseOver : Set an Event to play when the mouse moves over the target control.

OnMouseOut : Set an event to play when the mouse moves away from the target control.

OnHoverOver : Set an event to play when the mouse moves over the target control but it stop the OnHoverOut  animation before it plays.

OnHoverOut : Set an event to play when the mouse moves away from the target control but it stop the OnHoverOver animation before it plays.

© Copyright 2013 Computer Programming | All Right Reserved