简体   繁体   中英

Generate custom Azure web form

I am working on Azure C# project. There is webrole with web form collecting customer's information.

Depending on the information, they submit I need to create new custom web form for each one of them.

How can I generate new web form with custom web controls inside same site with code? I would prefer not create different site for each customer.

Any ideas appreciated!

You don't have to create a custom web form for each customer, you can have it all in on dynamic form and draw the input controls according to the customer.

You will have to have a form a form or a database table to configure the input needed for each customer which will be used in drawing the form.

ex: You can have a table named: CustomerAttibute with the following columns

  1. Customer ID
  2. Attribute Name
  3. Attribute Type (Number, text, boolean, ...)
  4. Is Required
  5. Validation Reg Expression

In the web form, you will read the customer ID and retrieve the attributes related to that customer, and use these attributes to draw the form, ex: an attribute of type text will be rendered as a textbox but an attribute of type boolean will be rendered as a checkbox

Capture the values from the user and insert it into another table, ex: CustomerAttributeValue which will have the attribute ID and attribute value, the value will be string to accommodate for any type

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM