Showing posts with label Tech Altum. Show all posts
Showing posts with label Tech Altum. Show all posts

Monday, 22 April 2013

Themes in Asp.net


Written By:- Isha Malhotra(malhotra.isha3388@gmail.com)
If you find this article useful then leave your comment

Themes in Asp.net

Sometimes we need to change the layout of application for different-different user. For example if a single application is used by different-different client and every client has his own color schema, logo, font etc. requirements then we use themes
A theme is a collection of skin files, css, graphics, images etc.

Add Theme

To add theme we have to first create the theme folder using name App_Themes.



Figure 1

Sunday, 31 March 2013

create single event for multiple Button or LinkButton


For Asp.net Training  Click Here

Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com


How to create single event for multiple Button or LinkButton

In my last article I discussed how we create event for control which we generate at runtime. In this article I am discussing how to create a single event for multiple controls and how we access all control through single even.

Just remember the example for searching where a list is showing with alphabet and on which alphabet we click the list generated according to it.

I am taking the same example here.



Figure 1

Friday, 29 March 2013

Add Click Event in Button at Runtime


For Asp.net Training  Click Here

Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com


Add Click Event in Button At Runtime

In my last article I discussed how to create control at runtime. Now I am discussing that if we want to make any event on any control then how we generate. To understand the concept of event you must have the knowledge of Delegate

For Example:-

In my Last Artical I create simple program of two number sum where I created control at run time. I am continuing with same example in which now I am creating event for button click and performing sum operation on that controls which we generated at runtime.

In this article I also explain how to access the runtime generated control.

To add event in the button I have to use the delegate EventHandler and add it in the click event and pass the reference of method to the EventHandler which will fire when we click on the button.

Create following method (you can say it event for button click)

protected void btn_Click(object sender, EventArgs e)
    {
   

   
    }

Now we have to pass the reference of this method to that button which we create at runtime. We have to add this reference to the event handler.

  Button btn_Sub = new Button();
        btn_Sub.ID = "bSum";
        btn_Sub.Text = "Sum";
        btn_Sub.Click += new EventHandler(btn_Click);

Thursday, 28 March 2013

Create Controls at Runtime in Asp.net


For Asp.net Training  Click Here

Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com

Create Controls at Runtime in Asp.net

In our working sometimes we need to create control at run time instead of compile time. In this article I am discussing how to create control at runtime.

Remember your first program in asp.net where you create sum of two numbers. At that time you create control at the compile time and show output on button click.

Same example I am taking here but I am creating control at runtime.

For Example:-

Take one panel at your design page so that you can add controls at runtime. Now check the following code:-

Default.aspx

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:Panel ID="Panel1" runat="server">
    </asp:Panel>
    </form>
</body>
</html>

Default.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //declare the object of table, Table row and Table Cell.
        Table TechAltum_Table = new Table();
        TableRow TechAltum_Row;
        TableCell TechAltum_Cell;

        //now create your first row
        TechAltum_Row = new TableRow();

        //now create your first cell

        TechAltum_Cell = new TableCell();

        //Now add message in the cell
        TechAltum_Cell.Text = "Enter First Number";

        //now add this cell in the row
        TechAltum_Row.Cells.Add(TechAltum_Cell);

        //now create second cell where we add one textbox
        TechAltum_Cell = new TableCell();

Tuesday, 5 March 2013

Study Material for Ajax


For Asp.net Training  Click Here

Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com

Basic of AJAX

Ajax is a platform independent technology. AJAX stands for Asynchronous JAvascript and Xml. Asynchronous refers to the events that are happening in the background Independently from the main application flow.
With the help of Ajax we can create an area in our web form Which post back and update without refreshing the whole page. It is called Partial page updating which increases the performance.
Ajax Controls
1.       ScriptManager
2.       ScriptManagerProxy
3.       Update Panel
4.       Timer Control
5.       Update Progress

Script Manager
Script manager is used to control the processing of Ajax. The major responsibility of script manager is for downloading Microsoft Ajax Library down to the browser (client).
Script manager’s EnablePartialRendering property must be set True which is its default value which is necessary for the script manager to manage Partial updating.
Update Panel
Update panal control is just like a container for other control. It defines an area in your page which will be independently partially post back without refreshing the whole page. A single page can have multiple update panel.
Example
In the following example we add one script manager and update panel at our page. In update panel we take one dropdown list and filled it with some countries and there is a lable in update panel too. We create event dropdown SelectedIndexChanged. In this event we take the dropdown selected item and show it in the lable. Check the following code:-

Thursday, 5 January 2012

Asp.Net Introduction

For Asp.net Training  Click Here

Written By:-Isha Malhotra
Email:-malhotra.isha3388@gmail.com  
                                     Asp.Net Introduction


Ques:-1 What is Asp.Net?
Ans:-Asp.net is a technology which provides features to develop a web application, console application and a mobile application.

Ques:-2 Compilation of Asp.Net code
Or
Asp.Net code whether compiled or interpreted?