none
SharePoint 2010 Visual Web Part RRS feed

  • Question

  • Hello,

    I want to create multiple Visual Web Parts for multiple departments.

    eg. 1. HR department having three units:- a. Recruitment b. Leave Management c. Induction

          2. Finance dept having two units:- a. Expenditure  b. Revenue

    My requirement is, i need to create Visual Web Part for each unit, so could you please suggest me a proper way to create it using VS 2010, or a Development architecture? 

    (If I want to create individual project for each department and maintain the Visual Web Part under it.  )

    Thank You!

    Santosh

     

    Tuesday, February 3, 2015 10:42 AM

Answers

  • Hi Santosh,

    The best approach is to add all your webpart into single SharePoint solution, don't create multiple for each webpart.

    Another important thing is if your logic/functions are going to be same for all department and only department is going to vary then i will suggest to club everything in single webpart and try to fetch data depending on the department.


    Thanks.... ________________ Baba (MCTS, MCPD)

    • Marked as answer by Santosh_11 Thursday, February 5, 2015 8:37 AM
    Wednesday, February 4, 2015 6:41 AM
  • hi

    you don't have to create separate project for each web part. In VS you may have single project which will contain all web parts. You have several options:

    1. create separate publishing page for each department and add single appropriate web part on each page

    2. create single publishing page and add web parts for all departments on this page. After that target each web part using audiences to the correct department (e.g. if you have separate AD group for each department you may create audiences for all these groups in Central administration > Service applications > User profile service application and then target web parts to these audiences via web part properties).


    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

    • Marked as answer by Santosh_11 Thursday, February 5, 2015 8:37 AM
    Wednesday, February 4, 2015 7:39 AM

All replies

  • Hi,

    Instead of developing Multiple Visual webparts , you can achieve the same with Web Properties.Create Custom Properties and write logic based on that .

    check the below links for your reference.

    You can do the same with 2 approaches.

    http://sharepointkitchen.blogspot.in/2014/10/add-custom-webpart-properties.html

    http://sharepointkitchen.blogspot.in/2014/10/custom-web-part-properties-approach-2.html

    Don't forget to mark it as an Answer if it resolves your issue and Vote Me as helpful if it useful.


    Mahesh

    Wednesday, February 4, 2015 5:59 AM
  • Hi Santosh,

    The best approach is to add all your webpart into single SharePoint solution, don't create multiple for each webpart.

    Another important thing is if your logic/functions are going to be same for all department and only department is going to vary then i will suggest to club everything in single webpart and try to fetch data depending on the department.


    Thanks.... ________________ Baba (MCTS, MCPD)

    • Marked as answer by Santosh_11 Thursday, February 5, 2015 8:37 AM
    Wednesday, February 4, 2015 6:41 AM
  • hi

    you don't have to create separate project for each web part. In VS you may have single project which will contain all web parts. You have several options:

    1. create separate publishing page for each department and add single appropriate web part on each page

    2. create single publishing page and add web parts for all departments on this page. After that target each web part using audiences to the correct department (e.g. if you have separate AD group for each department you may create audiences for all these groups in Central administration > Service applications > User profile service application and then target web parts to these audiences via web part properties).


    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

    • Marked as answer by Santosh_11 Thursday, February 5, 2015 8:37 AM
    Wednesday, February 4, 2015 7:39 AM