Custom ASP.NET form as default content type [modified]
-
-
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
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
-
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
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 .
-
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 .
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
-
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 .
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
-
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 .
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
-
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
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.
-
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.
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
-
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
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