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
 

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
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionNot working in iPhone Please help me urgentmemberMember 98629989 May '13 - 11:38 
QuestionThanks!!!memberRuhrerJung26 Jun '12 - 21:46 
QuestionTHANKKKSSSSS.....memberLeohh224 Jun '12 - 0:33 
GeneralMy vote of 2memberSravan S5 Jan '12 - 22:38 
GeneralMy vote of 5memberrnbergren25 Aug '11 - 9:15 

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

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 10 May 2011
Article Copyright 2011 by Melick
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid