First I want to know how to create an asp.net form and connect it with SharePoint, I want to create an asp.net form just like InfoPath forms.

Second I want to retrieve all items from my list to grid view in my asp.net form

Thanks for attention!


The best practice to do that is to develop visual web part then host it inside SharePoint Site web part page . The visual web part will work like ASP.page inside SharePoint .

To Create Visual Web Part.

  • Open Visual studio > New Project > Empty SharePoint SSolution.
  • Right Click on your project and select Add new item > add Visual Web Part.

To retrieve SharePOint list items and bind it to grid view.

  • Open the created Visual web part > from tool box add grid view .

  • In code write the following code with your list name and grid view name.

protected void Page_Load(object sender, EventArgs e)  
            SPWeb web = SPContext.Current.Web;  
            SPList list = web.Lists["Employee"];  
            SPListItemCollection items = list.Items;  
            mygrid.DataSource = items.GetDataTable();  

  • Deploy your solution.
  • Go to your web part page inside your SharePoint > Edit it.
  • Click Add web part and select your web part.

It's should now show your created web part that has a grid view with your list items

| improve this answer | |
  • I am also here if you need more clarification – Mohamed El-Qassas MVP Jul 29 '16 at 17:29
  • Thanks, this is working properly but I down't want this to be as a webpart, but I want on a blank page with some asp forms. to be a white page with some controls. I don't know if you are understanding me what I want. – Nderon Hyseni Jul 30 '16 at 9:52
  • you can create application page or asp.net and host it in page viewer web part as I frame – Mohamed El-Qassas MVP Jul 30 '16 at 10:56
  • Any tutorial how how to do this or any link? – Nderon Hyseni Aug 1 '16 at 7:29
  • Are you have a normal ASP.Net web application now ? – Mohamed El-Qassas MVP Aug 1 '16 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.