none
Insert data source in SharePoint Designer 2013 RRS feed

  • Question

  • Hi everybody,

    I am new here though trying to observe all forum policies. I am German - so please accept some language difficulties.

    First of all this looks to me as the appropriate forum to publish my question, please advice if I should publish it somewhere else.

    I want to filter flexible a library. Therefore I want to use a list that I created, lets say with information on orders of the company, to show up in a drop down list and after choosing an entry the library should be filtered accordingly. To accomplish this I am using the sharepoint designer and wanted to follow a very nice way, that is described in a very nice German book. 
    The quintessence described is to create an aspx website page, insert a drop down field, insert a asp.net dropdownlist which I did. Now I would have to add a datasource and this is exactly the issue where I need your help. In SharePoint designer 2013 within the ribbon "Insert" I can choose the list I want to use and insert it but I have no idea how to connect it to the drop down list.

    Anybody any idea?

    Thanks a lot for any reply

    Stefan
    Friday, May 29, 2020 10:01 AM

All replies

  • Hi Stefan,

    You could achieve this by using some code.

    1. Open Microsoft Visual Studio.

    2. Create a new SharePoint 2013 Empty Project.

    3. Add a new visual web part into it.

    <asp:DropDownList ID="drpbind" runat="server"
    AutoPostBack="true">  
    
    </asp:DropDownList>  
    
    Using microsoft.SharePoint;  
    
    protected void Page_Load(object sender, EventArgs e)   
    
    {  
    
        if (!Page.IsPostBack)   
    
        {  
    
            using(SPSite site = new SPSite("http://winserver/sites/customsite/"))   
    
            {  
    
                using(SPWeb web = site.OpenWeb())   
    
                {  
    
                    SPList list = web.Lists["Authors"];  
    
                    drpbind.DataSource = list.Items;  
    
                   
                    drpbind.DataValueField = "Title";   
    
                   
                    drpbind.DataTextField = "Title";   
    
                   
                    drpbind.DataBind();  
    
                  }  
    
            }  
    
        }  
    
    } 

    Reference:

    https://www.c-sharpcorner.com/UploadFile/746cd9/bind-dropdownlist-in-sharepoint-using-C-Sharp/

    Best regards,

    Emily Du


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.


    Monday, June 1, 2020 9:40 AM
  • Hi Emily,

    Sorry but my problems are starting at point 2.. Though I installed Visual Studio (2019) it does not let me create a project as "SharePoint Server is not installed on this system". I have no idea how to install a SharePoint 2013 instance on my computer and I am not able to connect Visual Studio with the SharePoint instance of the company ...

    (Sorry I just wanted to make the SharePoint of the company a little better ...)

    Thanks for your help!!!

    Stefan

    Tuesday, June 2, 2020 6:56 AM