Monday, 4 June 2012

ASCX(.ascx)

STEP 1: Create a VisualWebPart like PropellerStudio

STEP 2: Write a coding in PropellerStudioUserControl.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="PropellerStudioUserControl.ascx.cs" Inherits="VCSB01.INTRANET.VCSBWebPart.PropellerStudio.PropellerStudioUserControl" %>

 <%@ 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_left">
        <h4>
            Propeller Studio</h4>
    </div>
    <div class="add_side_right">
        <asp:ImageButton ID="imgbtnPropellerAdd" ImageUrl="/_layouts/Images/VCSB/plus_nor.gif"
            runat="server"  />
    </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">
       <table>
       <tr>
       <td>
           <asp:GridView ID="grdPropeller"  Width="100%" runat="server" BorderStyle="None"
               AutoGenerateColumns="False" GridLines="None"
               ShowHeader="False">
               <Columns>
               <asp:TemplateField>
            <ItemStyle Width="150px"/>
            <ItemTemplate>
             <asp:HyperLink ID="HypFileImage" NavigateUrl='<%# Eval("FilePathUrl") %>' runat="server">
             <asp:Image ID="imgFileImage" ImageUrl='<%# Eval("FileImage")%>' Height="50px" Width="50px" runat="server" />
             </asp:HyperLink>
            </ItemTemplate>
              </asp:TemplateField>
                   <asp:TemplateField>
                       <ItemStyle Width="350px" />
                       <ItemTemplate>
                           <asp:HyperLink ID="HypTitle" NavigateUrl='<%# Eval("FilePathUrl") %>' runat="server"><%# Eval("Title") %></asp:HyperLink>                                                
                     
                       <br />
                          </ItemTemplate>
                   </asp:TemplateField>
               </Columns>
           </asp:GridView>
       </td>
       </tr>
       </table>
    </div>   
    <div class="readmore">
        <asp:LinkButton ID="lnkbtnPropellerReadMore" PostBackUrl="/Pages/PropellerStudioReadMore.aspx" runat="server">Read more</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="propellerdiv" 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;Propeller Studio</td>
            <td class="bg_pop_uphead">
                <asp:ImageButton ID="imgbtnPropellerClose" 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="txtPropellerTitle" Width="280px" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td align="right" valign="top">
                Description</td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtPropellerDescription" 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="fldPropeller" runat="server" />
            </td>
        </tr>
        <tr>
            <td align="right" valign="top">
                &nbsp;</td>
            <td align="left" valign="top">
                <asp:Button ID="btnPropellerSubmit" runat="server" CssClass="bg_pop_up_btn"
                    Text="Submit" onclick="btnPropellerSubmit_Click" />
                <asp:Button ID="btnPropellerClear" runat="server" CssClass="bg_pop_up_btn"
                    Text="Clear" onclick="btnPropellerClear_Click" />
            </td>
        </tr>
        <tr>
            <td align="right" valign="top">
                &nbsp;</td>
            <td align="left" valign="top">
                &nbsp;
            </td>
        </tr>
    </table>
</div>

<cc1:ModalPopupExtender ID="mpePropeller" TargetControlID="imgbtnPropellerAdd" BackgroundCssClass="modalBackground" PopupControlID="propellerdiv" CancelControlID="imgbtnPropellerClose" 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 ; ...