Create Web Forms for Web Part Pages

You can create Web forms for a Web site to display data. You use Web parts to add Web forms to Web part pages. For more information, see Create Web Part Pages.

It is recommended that you do not add code to forms. For more information, see No Code in Forms. If you do add code to forms, the following measures are recommended to help prevent the execution of malicious code:

  • If you override the init and layout methods on Web forms to perform database updates, confirm that the request to perform the action is valid by calling the WebSession.isPostSafe method.

  • Do not execute an action by using an HTTP GET request.

  1. In the Application Object Tree (AOT), expand the Web node.

  2. Right-click Web Forms, and then click New Web Form.

  3. Add a table, and then design the form layout.

    For more information, see Create Forms by Using the AOT.

    You can set the SecurityKey property on Web form controls. For more information, see Report Control Properties.

  4. You can add a query to the form by doing the following:

    1. Expand the table node you added in step 3, right-click Methods, and then click either ExecuteQuery or Init.

    2. Use X++ code to create a query. For more information, see Query Object Model and Coordinate Two Forms by Overriding an Event Method.

      NoteNote

      When you call the Query.addDataSource method, you must specify the data source name using the Name parameter. Otherwise, you cannot sort data in the WebGrid control on the form.


  1. In the AOT, expand the Web node, and then expand the Web Content node.

  2. Right-click Display, and then click New Display Content Item.

  3. Right-click the new display content item that you created in Step 2, and then click Properties.

  4. In the property sheet, select a Web form from the Object property list.

  5. Modify other properties as needed.

  6. Right-click the content item, and then click Save.

    The content item displays in the WebDisplayContentItemName property list for the WebFormWebPart. For more information, see Web Part Properties.

  • Right-click the Web form, click Add-Ins > .

Community Additions

ADD
Show: