5 <div class="container">
\r
8 Within a <code>SmartDispatcherController</code> you can now associate classes to be
\r
9 populated with data from your form. Just use the
\r
10 DataBindAttribute on one or more arguments on your action.
\r
13 <p>Suppose you have the following form contents on your page:</p>
\r
16 Name: <input type="text" name="name">
\r
17 Address: <input type="text" name="address">
\r
18 E-mail: <input type="text" name="email">
\r
20 <select name="age">
\r
21 <option>18</option>
\r
22 <option>19</option>
\r
23 <option>20</option>
\r
24 <option>21</option>
\r
28 <p>And your Account class looks like the following code:</p>
\r
31 namespace Yournamespace
\r
33 public class Account
\r
35 private String name;
\r
36 private String address;
\r
37 private String email;
\r
42 get { return name; }
\r
43 set { name = value; }
\r
46 public String Address
\r
48 get { return address; }
\r
49 set { address = value; }
\r
54 get { return email; }
\r
55 set { email = value; }
\r
61 set { age = value; }
\r
67 <p>The DataBind will automatically fills the account instance for you</p>
\r
70 namespace Yournamespace
\r
72 public class AccountController : SmartDispatcherController
\r
74 public void Update([DataBind] Account account)
\r
82 You may want to use prefixes to avoid collisions as well:
\r
86 namespace Yournamespace
\r
88 public class AccountController : SmartDispatcherController
\r
90 public void Update([DataBind(Prefix="account")] Account account)
\r
98 In this case, the form would look like:
\r
102 Name: <input type="text" name="account.name">
\r
103 Address: <input type="text" name="account.address">
\r
104 E-mail: <input type="text" name="account.email">
\r
106 <select name="account.age">
\r
107 <option>18</option>
\r
108 <option>19</option>
\r
109 <option>20</option>
\r
110 <option>21</option>
\r