Thursday, January 21, 2010

Create custom application page in sharepoint 2007

/*******************Test.aspx*******************************/
<%@ Page Language="C#" MasterPageFile="~/_layouts/application.master" Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase" %>


<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{
    this.Label1.Text = "Samarendra swain";
}

protected void btnSubmit_onclick(object sender, EventArgs e)
{
   this.Label1.Text = "Hi...";
   this.txtValue.Text = "click submit";
}

</script>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<h1>Testing custom application page</h1>
<asp:Label Text="Hello World" runat="server" ID="Label1"></asp:Label>
<asp:TextBox runat="server" ID="txtValue"></asp:TextBox>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_onclick" />

copy this test.aspx file in this location _layouts/Test.aspx
run with this url like http://testsite/_layouts/Test.aspx
</asp:Content>
/**********************End********************************** /
Try it out and enjoy.............

No comments:

Post a Comment