Rich
3/14/2002 9:58:00 PM
> When I create new form through the Mobile Web.Net Wizard
> the only controls I can add is the controls on the
> toolbar. But I'd like to use all the power of ASP.Net on
> mobile forms. I even can't put two buttons on one line.
Igor,
MMIT contains only general components which you can use on all supported
devices. Table will run only on devices with browsers supporting HTML. I you
want to use tables anyway, you can specify part of your code as a HTML
dependend code (CHOICE tag with appropriate Filter, in our case, I specified
that code would run only on devices which support HTML 3.2 - so devices
without HTML support will jump over the code to the next line after
</CHOICE>. Your code can contain several CHOICE tags and they work almost
like switch/case statement in C, C++ language)
Note, that my table contains another mobile components which you can access
thru Collection:
protected void OnLogin(object sender, System.EventArgs e)
{
Label1.Text =
((System.Web.UI.MobileControls.TextBox)Panel2.Controls[0].Controls[3]).Text;
this.ActiveForm = Form2;
}
Following is the ASPX page which contains HTML table:
<mobile:Form id="Form1" runat="server" Font-Size="Large" Font-Bold="False">
<mobile:Panel id="Panel2" runat="server">
<mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
<Choice xmlns="Mobile HTML3.2 Template" Filter="isHTML32">
<ContentTemplate>
<br />
<table cellpadding="0" cellspacing="0" align="center">
<tr>
<td><mobile:Label id="user" runat="server" Text="UserName"
BreakAfter="false"></mobile:Label></td>
<td><mobile:TextBox id="user_box" runat="server" Size="12"
BreakAfter="false"></mobile:TextBox></td>
</tr>
<tr>
<td><mobile:Label id="password" Text="Password" runat="server"
BreakAfter="false"></mobile:Label></td>
<td><mobile:TextBox id="pass" runat="server" Size="12"
BreakAfter="false"></mobile:TextBox></td>
</tr>
<tr>
<td></td>
<td><mobile:Command id="login" OnClick="OnLogin" runat="server"
Text="Login" /></td>
</tr>
</table>
</ContentTemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:Panel>
</mobile:Form>
Rich