Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. Custom ASP.NET form as default content type [modified]

Custom ASP.NET form as default content type [modified]

Scheduled Pinned Locked Moved SharePoint
csharpasp-netsharepointquestion
9 Posts 2 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sidhu688
    wrote on last edited by
    #1

    Hi Can someone please tell me that how can i make data go from a asp.net form to a list in sharepoint ie when user opens the form and clicks save the data should get stored in the sharepoint list. Thanks

    modified on Sunday, March 14, 2010 8:40 PM

    S S 2 Replies Last reply
    0
    • S sidhu688

      Hi Can someone please tell me that how can i make data go from a asp.net form to a list in sharepoint ie when user opens the form and clicks save the data should get stored in the sharepoint list. Thanks

      modified on Sunday, March 14, 2010 8:40 PM

      S Offline
      S Offline
      siva sharepoint
      wrote on last edited by
      #2

      Hello Sin, Let me give alternative method to do without writing Submit Button code in the ASPX page : Step1:Create a SharePoint List with columns(if Required) to Save data whenever user clicks the Submit Button in the ASPX form Step2: Open the List in the SharePoint Designer and Check Out the List and Navigate to navigate it to NewForm.aspx(default APSX pages for a list) Step3: Right Click on NewForm.aspx and Select New from Existing Aspx page named it as NewForm1.aspx Step4: Open the NewForm1.aspx in the SharePoint Designer and Hoovers it as Default to Master Content Step5: Select Insert Menu in the top of the options and Navigate to SharePoint Controls Step6: Navigate the SharePoint Controls you will get the option Custom List Form Step7: Click it you will see all the columns created in the List with Button OK and Cancel Step8: Customize the Button Text and Value Step9: Customize the ASPX page Example: creating the Custom Master Page and CSS and Apply for the NewForm1.aspx Step10: Fill all details for the Columns in the Textbox’s and Click the Button Ok Step11: It will Automatically Save the data in the SharePoint List and Refresh it Done!!!! Regards, Siva(SharePoint Developer) Egon Software Pvt Ltd, Nagar Road,Pune

      modified on Sunday, April 25, 2010 10:45 AM

      S 1 Reply Last reply
      0
      • S sidhu688

        Hi Can someone please tell me that how can i make data go from a asp.net form to a list in sharepoint ie when user opens the form and clicks save the data should get stored in the sharepoint list. Thanks

        modified on Sunday, March 14, 2010 8:40 PM

        S Offline
        S Offline
        sidhu688
        wrote on last edited by
        #3

        Hi , Thanks for replying Rao ...i know of this customization of newform but don't know excatly what all can be done ...i ll tell u my scenario...i have a form and all the data from that form has to go in a custom list ..now the thing is that in the form there is a feature of repeating table column ie the user who fills the form can enter one row or might be 2 ,,3 or any ....and this data has to be stored in the list now i want to know that how can i create columns on the fly ie i want to have a table in this customized newform that users can fill and then when they click save the data should be stored in the custom list .

        S 3 Replies Last reply
        0
        • S sidhu688

          Hi , Thanks for replying Rao ...i know of this customization of newform but don't know excatly what all can be done ...i ll tell u my scenario...i have a form and all the data from that form has to go in a custom list ..now the thing is that in the form there is a feature of repeating table column ie the user who fills the form can enter one row or might be 2 ,,3 or any ....and this data has to be stored in the list now i want to know that how can i create columns on the fly ie i want to have a table in this customized newform that users can fill and then when they click save the data should be stored in the custom list .

          S Offline
          S Offline
          siva sharepoint
          wrote on last edited by
          #4

          Hi Sin, i understood the scenario can you give me sometime so that i can start doing in my machine and forwared the steps to make it clear for all. i will send the procedure tomorrow Cheers, Regards, Siva(SharePoint Developer) Egon Software Pvt Ltd, Nagar Road,Pune

          1 Reply Last reply
          0
          • S sidhu688

            Hi , Thanks for replying Rao ...i know of this customization of newform but don't know excatly what all can be done ...i ll tell u my scenario...i have a form and all the data from that form has to go in a custom list ..now the thing is that in the form there is a feature of repeating table column ie the user who fills the form can enter one row or might be 2 ,,3 or any ....and this data has to be stored in the list now i want to know that how can i create columns on the fly ie i want to have a table in this customized newform that users can fill and then when they click save the data should be stored in the custom list .

            S Offline
            S Offline
            siva sharepoint
            wrote on last edited by
            #5

            Hello Sin, Please Check the link mentioned below [http://msdn.microsoft.com/en-us/library/ms467435.aspx Cheers, Siva... Regards, Siva(SharePoint Developer) Egon Software Pvt Ltd, Nagar Road,Pune

            modified on Sunday, April 25, 2010 10:42 AM

            ](http://msdn.microsoft.com/en-us/library/ms467435.aspx)

            1 Reply Last reply
            0
            • S sidhu688

              Hi , Thanks for replying Rao ...i know of this customization of newform but don't know excatly what all can be done ...i ll tell u my scenario...i have a form and all the data from that form has to go in a custom list ..now the thing is that in the form there is a feature of repeating table column ie the user who fills the form can enter one row or might be 2 ,,3 or any ....and this data has to be stored in the list now i want to know that how can i create columns on the fly ie i want to have a table in this customized newform that users can fill and then when they click save the data should be stored in the custom list .

              S Offline
              S Offline
              siva sharepoint
              wrote on last edited by
              #6

              Hello Sindhu, Try this code to submit aspx data to SharePoint List when user click the submit button protected void btnSubmit_Click(object sender, EventArgs e) { using (SPSite currentSite = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb currentWeb = currentSite.OpenWeb()) { userName = currentWeb.CurrentUser.LoginName; /*This method will display error messages for all radio button and check boxes*/ DisplayErrorMessages(); if (string.IsNullOrEmpty(lblErrorMessage.Text)) { /*this method will save all the answers into the list*/ SaveAnswers(userName); } } } } private void SaveAnswers(string userName) { /*This section will save all the answers*/ try { if (userPickerApplicationOwner.CommaSeparatedAccounts != string.Empty && userPickerITSME.CommaSeparatedAccounts != string.Empty && userPickerBusinessSME.CommaSeparatedAccounts != string.Empty) { SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite currentSite = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb currentWeb = currentSite.OpenWeb()) { currentWeb.AllowUnsafeUpdates = true; PickerEntity entityApplicationOwner = (PickerEntity)userPickerApplicationOwner.Entities[0]; PickerEntity pickerEntityITSME = (PickerEntity)userPickerITSME.Entities[0]; PickerEntity pickerEntityBusinessSME = (PickerEntity)userPickerBusinessSME.Entities[0]; SPList answerList = currentWeb.Lists[applicationAnswersList]; SPListItem answerListItem = null; answerListItem = answerList.Items.Add(); answerListItem["A1"] = ddlApplicationProvisioning.SelectedItem.Text; answerListItem["A2"] = ddlApplicationName.SelectedItem.Text; SPUser user = currentWeb.En

              S 1 Reply Last reply
              0
              • S siva sharepoint

                Hello Sindhu, Try this code to submit aspx data to SharePoint List when user click the submit button protected void btnSubmit_Click(object sender, EventArgs e) { using (SPSite currentSite = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb currentWeb = currentSite.OpenWeb()) { userName = currentWeb.CurrentUser.LoginName; /*This method will display error messages for all radio button and check boxes*/ DisplayErrorMessages(); if (string.IsNullOrEmpty(lblErrorMessage.Text)) { /*this method will save all the answers into the list*/ SaveAnswers(userName); } } } } private void SaveAnswers(string userName) { /*This section will save all the answers*/ try { if (userPickerApplicationOwner.CommaSeparatedAccounts != string.Empty && userPickerITSME.CommaSeparatedAccounts != string.Empty && userPickerBusinessSME.CommaSeparatedAccounts != string.Empty) { SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite currentSite = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb currentWeb = currentSite.OpenWeb()) { currentWeb.AllowUnsafeUpdates = true; PickerEntity entityApplicationOwner = (PickerEntity)userPickerApplicationOwner.Entities[0]; PickerEntity pickerEntityITSME = (PickerEntity)userPickerITSME.Entities[0]; PickerEntity pickerEntityBusinessSME = (PickerEntity)userPickerBusinessSME.Entities[0]; SPList answerList = currentWeb.Lists[applicationAnswersList]; SPListItem answerListItem = null; answerListItem = answerList.Items.Add(); answerListItem["A1"] = ddlApplicationProvisioning.SelectedItem.Text; answerListItem["A2"] = ddlApplicationName.SelectedItem.Text; SPUser user = currentWeb.En

                S Offline
                S Offline
                sidhu688
                wrote on last edited by
                #7

                Thanks Siva ..but now the requiremnts have changed and i won't be using the aspx forms ..but thanks for help the code great ..learned some good points from that ... Can you plz tell me that how can i show data from sql server in sharepoint list ...ie i wabt a column in a custom list that when user fills the column data he will get a drop down that will show data from a sql server database and then when he selects a value i want some other fields to get auto populated getting their data also from the database.

                S 1 Reply Last reply
                0
                • S sidhu688

                  Thanks Siva ..but now the requiremnts have changed and i won't be using the aspx forms ..but thanks for help the code great ..learned some good points from that ... Can you plz tell me that how can i show data from sql server in sharepoint list ...ie i wabt a column in a custom list that when user fills the column data he will get a drop down that will show data from a sql server database and then when he selects a value i want some other fields to get auto populated getting their data also from the database.

                  S Offline
                  S Offline
                  siva sharepoint
                  wrote on last edited by
                  #8

                  Hello Sin, I am having the code Getting data from the sql server for a dropdown list i will send it in the evening and selected field autogenerated to show extra information this scenario we can try it using JavaScript or we can try it using AJAX Controls i will give some breif descrition tomorrow regarding this scenario Cheers, Regards, Siva(SharePoint Developer) Egon Software Pvt Ltd, Nagar Road,Pune

                  modified on Sunday, April 25, 2010 10:44 AM

                  1 Reply Last reply
                  0
                  • S siva sharepoint

                    Hello Sin, Let me give alternative method to do without writing Submit Button code in the ASPX page : Step1:Create a SharePoint List with columns(if Required) to Save data whenever user clicks the Submit Button in the ASPX form Step2: Open the List in the SharePoint Designer and Check Out the List and Navigate to navigate it to NewForm.aspx(default APSX pages for a list) Step3: Right Click on NewForm.aspx and Select New from Existing Aspx page named it as NewForm1.aspx Step4: Open the NewForm1.aspx in the SharePoint Designer and Hoovers it as Default to Master Content Step5: Select Insert Menu in the top of the options and Navigate to SharePoint Controls Step6: Navigate the SharePoint Controls you will get the option Custom List Form Step7: Click it you will see all the columns created in the List with Button OK and Cancel Step8: Customize the Button Text and Value Step9: Customize the ASPX page Example: creating the Custom Master Page and CSS and Apply for the NewForm1.aspx Step10: Fill all details for the Columns in the Textbox’s and Click the Button Ok Step11: It will Automatically Save the data in the SharePoint List and Refresh it Done!!!! Regards, Siva(SharePoint Developer) Egon Software Pvt Ltd, Nagar Road,Pune

                    modified on Sunday, April 25, 2010 10:45 AM

                    S Offline
                    S Offline
                    siva sharepoint
                    wrote on last edited by
                    #9

                    Hello Sin, Let me give alternative method to do without writing Submit Button code in the ASPX page : Step1:Create a SharePoint List with columns(if Required) to Save data whenever user clicks the Submit Button in the ASPX form Step2: Open the List in the SharePoint Designer and Check Out the List and Navigate to navigate it to NewForm.aspx(default APSX pages for a list) Step3: Right Click on NewForm.aspx and Select New from Existing Aspx page named it as NewForm1.aspx Step4: Open the NewForm1.aspx in the SharePoint Designer and Hoovers it as Default to Master Content Step5: Select Insert Menu in the top of the options and Navigate to SharePoint Controls Step6: Navigate the SharePoint Controls you will get the option Custom List Form Step7: Click it you will see all the columns created in the List with Button OK and Cancel Step8: Customize the Button Text and Value Step9: Customize the ASPX page Example: creating the Custom Master Page and CSS and Apply for the NewForm1.aspx Step10: Fill all details for the Columns in the Textbox’s and Click the Button Ok Step11: It will Automatically Save the data in the SharePoint List and Refresh it Done!!!! Regards, Siva

                    modified on Saturday, August 14, 2010 2:58 AM

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups