Monday, 4 June 2012

ASCX(.ascx)

STEP 1: Create a VisualWebPart like HealthAndWellness

STEP 2: Write a coding in HealthAndWellnessUserControl.ascx


STEP 3:


<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HealthAndWellnessUserControl.ascx.cs" Inherits="VCSB01.INTRANET.VCSBWebPart.HealthAndWellness.HealthAndWellnessUserControl" %>

 <%@ Register Assembly="AjaxControlToolkit, Version=3.0.30512.20315, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"
    Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<link href="/_layouts/Styles/VCSB/style.css" rel="stylesheet" type="text/css" />

<link href="/_layouts/Styles/VCSB/Blog.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.modalBackground
{   
    position: absolute;
            z-index: 100;
            top: 0px;
            left: 0px;
            background-color: #000;
            filter: alpha(opacity=60);
            -moz-opacity: 0.6;
            opacity: 0.6;
}


</style>
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</asp:ScriptManagerProxy>



    <div class="menu_bg_sd">
        <div class="menu_left_sd">
        </div>
        <div class="menu_right_sd">
        </div>
        <div class="add_side_main">
            <div class="add_side_left">
                <h4>
                    Health and Wellness</h4>
            </div>
            <div class="add_side_right">
                <asp:ImageButton ID="imgbtnHealthAdd" ImageUrl="/_layouts/Images/VCSB/plus_nor.gif" runat="server" />
            </div>
        </div>
    </div>
    <div class="menu_bg_sd_ind">
        <div class="menu_left_sd_ind">
        </div>
        <div class="menu_right_sd_ind">
        </div>
        <div class="box_inner_m2">
            <asp:Image ID="imgHealth" ImageUrl="/_layouts/Images/VCSB/image_health.jpg" Width="237"
                Height="193" runat="server" />
        </div>
        <div class="readmore">
        <asp:LinkButton ID="lnkbtnHealthReadMore" PostBackUrl="/Pages/HealthAndWelnessReadMore.aspx" runat="server">View Articles</asp:LinkButton>
        </div>
    </div>
    <div class="menu_bg_sd_bot">
        <div class="menu_left_sd_bot">
        </div>
        <div class="menu_right_sd_bot">
        </div>
    </div>

              
<div id="healthandwelness" class="bg_pop_up" style="display:none">
    <table align="center" border="0" cellpadding="5" cellspacing="0" width="100%">
        <tr style="height: 40px;">
            <td class="bg_pop_uphead" colspan="2">
                &nbsp;Health and Welness
            </td>
            <td class="bg_pop_uphead">
                <asp:ImageButton ID="imgbtnHealthAndWelnessClose" runat="server" Height="20px" ImageUrl="/_layouts/images/VCSB/closebtn.png" />
            </td>
        </tr>
        <tr>
            <td align="right" valign="top">
                Title
            </td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtHealthTitle" Width="280px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" valign="top">
                Description
            </td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtHealthDescription" Width="280px" runat="server" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" valign="top">
                Upload Documents
            </td>
            <td align="left" valign="top">
                <asp:FileUpload ID="fldHealth" runat="server" />
            </td>
        </tr>
        <tr>
            <td align="right" valign="top">
                &nbsp;
            </td>
            <td align="left" valign="top">
                <asp:Button ID="btnHealthSubmit" runat="server" CssClass="bg_pop_up_btn"
                    Text="Submit" onclick="btnHealthSubmit_Click"/>
                <asp:Button ID="btnHealthClear" runat="server" CssClass="bg_pop_up_btn"
                    Text="Clear" onclick="btnHealthClear_Click"/>
            </td>
        </tr>
        <tr>
            <td align="right" valign="top">
                &nbsp;
            </td>
            <td align="left" valign="top">
                &nbsp;
            </td>
        </tr>
    </table>
</div>

<cc1:ModalPopupExtender ID="mpeHealthAndWelness" TargetControlID="imgbtnHealthAdd" BackgroundCssClass="modalBackground" PopupControlID="healthandwelness" CancelControlID="imgbtnHealthAndWelnessClose" PopupDragHandleControlID="header" runat="server">
</cc1:ModalPopupExtender>

No comments:

Post a Comment

SharePoint online - Get List-item attachments and Display to div

Step 1 : Create a List ex: TestList and attach few images Step 2 : Copy and Pastet the below coding in App.js var  Items =  null ; ...