Tuesday 10 July 2012

How To use multiview in C# in asp.net

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;


public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {


    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
     
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = DropDownList1.SelectedIndex;
    }
}


How To Use Multi View In C# in asp.net


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;


public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {


    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
     
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = DropDownList1.SelectedIndex;
    }
}

File Upload Code in asp.net


using System;
using System.Web.UI.WebControls;

public partial class Management_FileUpload : System.Web.UI.Page
{

  protected void Button1_Click(object sender, EventArgs e)
  {


  FileUpload FileUpload1 = file_Image;

  string virtualFolder = "~/images/tutorialimages/";

  string physicalFolder = Server.MapPath(virtualFolder);


  FileUpload1.SaveAs(physicalFolder + FileUpload1.FileName);


  lbl_Result.Text = "Your file " + FileUpload1.FileName + " has been uploaded.";

  Image1.Visible = true;
  Image1.ImageUrl = virtualFolder + FileUpload1.FileName;


  }
}

Code To Travel In a Html Page. . . .


<!DOCTYPE html>
<html>
<body>


<p>
<a href="#C4">See also Chapter 4.</a>
</p>


<h2>Chapter 1</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 2</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 3</h2>
<p>This chapter explains ba bla bla</p>


<h2><a name="C4">Chapter 4</a></h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 5</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 6</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 7</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 8</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 9</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 10</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 11</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 12</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 13</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 14</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 15</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 16</h2>
<p>This chapter explains ba bla bla</p>


<h2>Chapter 17</h2>
<p>This chapter explains ba bla bla</p>


</body>
</html>