Click here to Skip to main content
Click here to Skip to main content

How to Customize the New Item form to take parameters from Query String in SharePoint 2010

By , 10 May 2011
Rate this:
Please Sign up or sign in to vote.

In this article, I'm going to explain how to customize the SharePoint Item Form to take parameters from a Query String and set them as default values using the SharePoint Designer. Using this technique, you can open a new Item Form by providing parameters as query string. For example, you can customize an item display form and take a query string parameter from that form and view the New Item view for another list by providing the default values using the query string.  

Steps

Open the SharePoint Designer and go to Lists and Libraries and open the list you want.

image

Click New and create a New Insert View by providing the name of the view.

image 

image

The created view will appear in the list. Click and open the view.

image

The default New Item screen will be loaded as follows.

image

Delete the default list view and make that empty. You can delete the controls by selecting the area in the Design view. If it fully cleared, you will see the following message in the designer.

image

Go to SharePoint Controls and add the a Custom List as you want.

image

Select the New Item form and click OK to add the view.

image

In my example, I want to set the comments by using the query string parameter. So I change the Comments field’s controller to a textbox.

image

The add a parameter field to get the comments form the query string.

image

I'm passing my comments using the query string ID com and it will store it to the variable param.

image

Then select the Comments text box and switch the view to code or split designer mode.

image

image

Go and change the text property to {$param}. This will set the query string parameter to the text box.

image

Now you are done.

image

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Melick

Sri Lanka Sri Lanka
No Biography provided

Comments and Discussions

 
QuestionNot working in iPhone Please help me urgent PinmemberMember 98629989-May-13 11:38 
QuestionThanks!!! PinmemberRuhrerJung26-Jun-12 21:46 
QuestionTHANKKKSSSSS..... PinmemberLeohh224-Jun-12 0:33 
GeneralMy vote of 2 PinmemberSravan S5-Jan-12 22:38 
GeneralMy vote of 5 Pinmemberrnbergren25-Aug-11 9:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140421.2 | Last Updated 10 May 2011
Article Copyright 2011 by Melick
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid