Click here to Skip to main content
14,425,800 members

SharePoint

 
AnswerRe: WebPart Error Pin
Not Active14-May-12 15:53
mentorNot Active14-May-12 15:53 
AnswerRe: WebPart Error Pin
Ibrahim Hebish18-Jul-12 6:28
MemberIbrahim Hebish18-Jul-12 6:28 
QuestionAdd , Edit, and display list in one page Pin
vasudeo113-May-12 8:39
Membervasudeo113-May-12 8:39 
AnswerRe: Add , Edit, and display list in one page Pin
Not Active13-May-12 11:24
mentorNot Active13-May-12 11:24 
AnswerRe: Add , Edit, and display list in one page Pin
Christopher Stratmann18-May-12 5:35
MemberChristopher Stratmann18-May-12 5:35 
GeneralRe: Add , Edit, and display list in one page Pin
Not Active18-May-12 6:35
mentorNot Active18-May-12 6:35 
GeneralRe: Add , Edit, and display list in one page Pin
Christopher Stratmann21-May-12 3:33
MemberChristopher Stratmann21-May-12 3:33 
QuestionEnhance my client code Pin
teycir11-May-12 21:05
Memberteycir11-May-12 21:05 
Hello;
Can you please tell me how can I enhance my client side code of a sharepoint 2010 webpart project?
I'm using the code optimizer and beautifier 'Resharper', it does not suggest any refactoring or change on my code.
My application contains a single html page. Note that there is no head or body subdivision on purpose because the container (of the webpart) sharepoint page already contains that. I did not externalize the javascript into an external folder because there is so few javascript lines that I decided it is not worth it to create a special folder just to put 1 little script in it.
Thanks, Teycir.
Here's the code:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VisualWebPart1UserControl.ascx.cs" Inherits="AD_RW.VisualWebPart1.VisualWebPart1UserControl" %>
<meta http-equiv="X-UA-Compatible" content="IE=9" />

<applet archive="IDactisPCSC.jar"

        code="IDactisPCSC.class"

        name="IDactisPCSC" 

        width=0 height=0>
</applet>
<script type="text/javascript">

    function GetMyfare() {
        var readerName = GetReader();
        var set = document.IDactisPCSC.setActiveReader(readerName);
        RefreshCardSerial();
    }

    function GetReader() {
        var reader;
        var nb = document.IDactisPCSC.getReaderCount();
        var i;
        for (i = 0; i < nb; i++) {
            if (document.IDactisPCSC.getReaderName(i).search( /contactless/i ) != -1) {
                reader = document.IDactisPCSC.getReaderName(i);
            }
        }
        return reader;
    }

    function RefreshCardSerial() {
        document.getElementById('PCSCCardSerial').innerHTML = document.IDactisPCSC.getCardSerial();
    }

    // In order to fire from onload event within sharepoint webpart
    _spBodyOnLoadFunctionNames.push("GetMyfare");
    
</script>


<%--Css externalisée sur le dossier UI--%>
<Link rel=StyleSheet href="UI/WebpartDesign.css" type="text/css">

<div id="Panel" class="Panel" >
    <div id="Bande" style="background-image: url(UI/block_title_large.png);"  class="Bande">
        <table width="900px" >
            <tr >
                <td><asp:Label ID="LabelAjoutGarde" runat="server" 

                               Text="Ajout d'une garde" 

                               CssClass="Label"

                               style="color: #FFFFCC" ></asp:Label></td>
            </tr>
        </table>
    </div>
   
    <table width="900px" >
        <tr>
            <td>
                <asp:Label ID="LabelNom" runat="server" Text="Nom: " 

                           CssClass="Label"></asp:Label>   
            </td>  
            <td style="text-align: left">
                <asp:TextBox ID="TextBoxNom" runat="server" bold="true" 

                             police="arial" 

                             Width="250px" Height="20px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelUF" runat="server" 

                           Text="Unité fonctionnelle: " CssClass="Label"></asp:Label>    
            </td>
            <td style="text-align: left">
                <asp:DropDownList ID="DropDownListUF" runat="server" Width="450px" 

                                  Height="22px">
                </asp:DropDownList> 
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelSecteur" runat="server"  Text="Secteur: " bold="true" 

                           CssClass="Label"></asp:Label>    
            </td>
            <td style="text-align: left">
                <asp:DropDownList ID="DropDownListSecteur" runat="server" Width="450px" 

                                  Height="22px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelGrade" runat="server" Text="Grade: "

                           CssClass="Label"></asp:Label>    
            </td>
            <td style="text-align: left">
                <asp:DropDownList ID="DropDownListGrade" runat="server" Width="450px" 

                                  Height="22px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelMetier" runat="server" Text="Métier: " 

                          CssClass="Label"></asp:Label>    
            </td>
            <td style="text-align: left">
                <asp:DropDownList ID="DropDownListMetier" runat="server" Height="22px" 

                                  Width="450px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelMatricule" runat="server"  

                          Text="Matricule: " 

                           CssClass="Label"></asp:Label>    
            </td>
            <td style="text-align: left">
                <asp:TextBox ID="TextBoxMatricule" bold="true" 

                             police="arial"  runat="server" 

                             Width="250px" Height="21px" style="text-align: left" 

                    EnableTheming="True"   ></asp:TextBox>
                               <asp:CheckBox ID="CheckBoxMatricule" runat="server" 

                    

                    oncheckedchanged="CheckBoxMatricule_CheckedChanged" />
            </td>
            
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelCodeMyfare" runat="server"  Text="Code mifare: " 

                          CssClass="Label"></asp:Label>    
            </td>
            <td style="text-align: left">
                <asp:TextBox ID="TextBoxCodeMyfare" bold="true" 

                             police="arial"  runat="server" 

                             Width="250px" Height="21px" style="text-align: left"></asp:TextBox>
                              <asp:CheckBox ID="CheckBoxCodeMyfare" runat="server" 

                    

                     oncheckedchanged="CheckBoxCodeMyfare_CheckedChanged" />
            </td>
        </tr>
    </table>
    <br/>
   
    <table width="900px" >
        <tr>
            <td>
                <asp:Button ID="ButtonSearch" runat="server" Text="Rechercher" 

                             CssClass="Bouton"  

                            onclick="ButtonSearch_Click"  />
          
            </td>
        </tr> 
    </table>

</div>
<br/>

<div id="Panel1" class="Panel">
    <div id="Bande1" style="background-image: url(UI/block_title_large.png);" class="Bande">
        <table width="100%" >
            <tr >
                <td>
                    <asp:Label ID="LabelResultat" runat="server"  

                               Text="Résultat" 

                               CssClass="Label"

                               style="color: #FFFFCC; " ></asp:Label>
                </td>
            </tr>
        </table>
        
        
    

    </div>
    <asp:GridView ID="GridViewSearch" runat="server" OnSelectedIndexChanged="GridViewSearch_SelectedIndexChanged"

                  AutoGenerateColumns="False" DataKeyNames="SameAccountName" EnableModelValidation="True" CellSpacing="5" 

                  onrowdatabound="GridViewSearch_RowDataBound" Style="position: static" Width="100%">
        <Columns >
            <asp:ButtonField CommandName="Select" Visible="false" />
            <asp:BoundField DataField="Username" HeaderText="Nom" 

                            SortExpression="Username" />
            <asp:BoundField DataField="Firstname" HeaderText="Prénom"

                            SortExpression="Firstname" />
            <asp:BoundField DataField="Uf" HeaderText="Unité fonctionnelle"

                            SortExpression="Uf" />
            <asp:BoundField DataField="Secteur" HeaderText="Secteur"

                            SortExpression="Secteur" />
            <asp:BoundField DataField="Grade" HeaderText="Grade"

                            SortExpression="Grade" />
            <asp:BoundField DataField="Metier" HeaderText="Métier"

                            SortExpression="Metier" />
            <asp:BoundField DataField="SameAccountName" HeaderText="SameAccountName"

                            SortExpression="SameAccountName" Visible="False" />
        </Columns>
        <HeaderStyle CssClass="Grid-header" />
        <RowStyle CssClass="Grid-row" />
        <SelectedRowStyle BackColor="#99CCFF" />
    </asp:GridView>
</div>
<br/>
<div id="Panel2" class="Panel">
    <div id="Bande2" style="background-image: url(UI/block_title_large.png);" class="Bande">
        <table width="900px" >
            <tr >
                <td><asp:Label ID="LabelGarde" runat="server"  

                               Text="Garde" 

                               CssClass="Label"

                               style="color: #FFFFCC;" ></asp:Label></td>
            </tr>
        </table>
    </div>
   
    <br/>
    <table width="900px" align="center">
        <tr>
            <td> <asp:Label ID="LabelCarteAssociee" runat="server" Text="Carte associée:   " CssClass="Label"></asp:Label></td>
            <td>
                <asp:TextBox ID="TextBoxCarteAssociee" runat="server" Width="250px" 

                             Height="20px" ReadOnly="false"></asp:TextBox>
            </td>
       
            <td>
                <asp:Label ID="LabelPersonneSelectionnee" runat="server" Text="Personne selectionnée:   " CssClass="Label"></asp:Label>
            </td>
        
            <td>
                 <asp:Label ID="LabelContenuUtilisateur" runat="server"  CssClass="Label"></asp:Label>
            </td>
        </tr>
        <tr><td> </td></tr>
       
   <tr><td> </td></tr>
   
    </table>
    
    <table width="900px" align="center">
        <tr>
            <td>
                <asp:Button ID="ButtonEnregistrer" runat="server" Text="Enregistrer" 

                             CssClass="Bouton"  

                             onclick="ButtonEnregistrer_Click"   />
            </td>
    
            <td>       
                <asp:Button ID="ButtonSupprimer" runat="server" Text="Supprimer" 

                            CssClass="Bouton"  

                            

                            onclick="ButtonSupprimer_Click"   />
 
            </td>
            <td>       
                <asp:Button ID="ButtonActiver" runat="server" Text="Activer" 

                            CssClass="Bouton"  

                             onclick="ButtonActiver_Click"   />
            </td>
            <td>       
                <asp:Button ID="ButtonDesactiver" runat="server" Text="Désactiver" 

                            CssClass="Bouton"  

                           

                            onclick="ButtonDesactiver_Click" />
            </td>
      
            <td>       
                <asp:Button ID="ButtonAnnuler" runat="server" Text="Annuler" 

                            CssClass="Bouton"  

                             onclick="ButtonAnnuler_Click" />
            </td>
            
            <td>
                <asp:Label ID="LabelDesactivationDate" runat="server" Text="Date de désactivation:   " Font-Bold="True"></asp:Label>
            </td>
        
            <td>
                <asp:TextBox ID="TextBoxDesactivationDate" runat="server" Width="175px" 

                             Height="20px" ReadOnly="false" style="margin-left: 17px"></asp:TextBox>
            </td>
            
  
        </tr>
    </table>
    <br/>
    <table width="900px">
        <tr>
            <th align="left"><a href="javascript:GetMyfare()" title="Rafraichir la carte"><img src="UI/refresh.png" border="0" alt="Refresh" height="12" width="12" />Carte mifare</a></th>
            <td>
                <div id="PCSCCardSerial" style="font-weight: bolder" > </div>
            </td>
        </tr>
        <tr><td> </td></tr>
        <tr>
        <asp:Label ID="LabelIdactisResult" runat="server" ForeColor="blue" Font-Bold="True"></asp:Label>
        </tr>
   
    </table>
</div>


modified 12-May-12 3:34am.

AnswerRe: Enhance my client code Pin
ssivarao3-Jul-12 1:34
Memberssivarao3-Jul-12 1:34 
QuestionSharePoint Deployment Pin
Vishal Kumar Soni11-May-12 19:37
MemberVishal Kumar Soni11-May-12 19:37 
AnswerRe: SharePoint Deployment Pin
Not Active12-May-12 5:09
mentorNot Active12-May-12 5:09 
AnswerRe: SharePoint Deployment Pin
Nader Elshehabi12-May-12 6:20
MemberNader Elshehabi12-May-12 6:20 
AnswerRe: SharePoint Deployment Pin
Christopher Stratmann18-May-12 5:38
MemberChristopher Stratmann18-May-12 5:38 
GeneralRe: SharePoint Deployment Pin
Not Active21-May-12 10:17
mentorNot Active21-May-12 10:17 
GeneralRe: SharePoint Deployment Pin
Christopher Stratmann23-May-12 5:35
MemberChristopher Stratmann23-May-12 5:35 
GeneralRe: SharePoint Deployment Pin
Not Active23-May-12 6:07
mentorNot Active23-May-12 6:07 
GeneralRe: SharePoint Deployment Pin
Christopher Stratmann23-May-12 7:13
MemberChristopher Stratmann23-May-12 7:13 
QuestionCustom announcment board in Sharepoint 2007 Pin
_HawkeyeD10-May-12 12:53
Member_HawkeyeD10-May-12 12:53 
AnswerRe: Custom announcment board in Sharepoint 2007 Pin
Not Active10-May-12 16:28
mentorNot Active10-May-12 16:28 
QuestionHow to stream Pin
Siya Khumalo7-May-12 23:45
professionalSiya Khumalo7-May-12 23:45 
AnswerRe: How to stream Pin
Not Active9-May-12 5:27
mentorNot Active9-May-12 5:27 
AnswerRe: How to stream Pin
Nader Elshehabi12-May-12 1:43
MemberNader Elshehabi12-May-12 1:43 
QuestionIterating a sharepoint list and passing item content as xml from a wcf service? Pin
Steve Holdorf5-May-12 9:41
MemberSteve Holdorf5-May-12 9:41 
AnswerRe: Iterating a sharepoint list and passing item content as xml from a wcf service? Pin
Not Active9-May-12 5:29
mentorNot Active9-May-12 5:29 
Questionlog in portal Pin
Sarah MQ1-May-12 0:02
MemberSarah MQ1-May-12 0:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.