I want to know how to align the asp.net mobile controls in the mobile forms in Design Time.I can drag the textbox,Button,labels Controls etc., but i cant align the Controls as i need.The Controls seems to be Locked,it cant moved in panels in forms.
The mobile controls are quite limited when it comes to styling so they do not have support for things like alignment and cannot use HTML to set placements by using divs or tables. This is because alot of mobile devices do not support HTML and instead support
other modes like WML, cHTML, xHTML etc.
If you want to do specific HTML/CSS rendering like using tables divs alignment etc you can add a deviceSpecific filter to your panel. The filter will be selected for isHTML and they you can do standard HTML development within its content template.
I am trying to left align my mobile controls and also make some links bold. Is it safe to assume that this won't work becuase of the limitations specified above? It shows up on my ie browser but when I look through phone emulators I have no luck.
For HTML browsers [like PocketPC's,some models in Samsung,Motorola etc.,] mobile controls can be aligned by integrating the other control like GridView and DataGrid [Takes some more code but alignment is good].But when we are looking for WML devices,Alignment
is Poor,b'coz it will not support GridView or DataGrid.My Choice is use List,Selection List and Link in WML devices.Beyond the Feel and Look, User Interaction needs more care.
<mobile:Label
ID="lblProblems"
Runat="server"
BackColor="ControlLightLight"
ForeColor="DimGray"
Alignment="Left">Problems with the application?</mobile:Label>
Mobile controls have limited functionality.. I agree, it is hard to align controls in mobile applications compared to a normal asp.net website.
From my experience, I align my controls by setting the properties of the specific control..and in the ALIGNMENT property, you can choose to align your controls
mm_mobile
Member
1 Points
8 Posts
How to Align the Controls in Mobile Web Forms
Nov 21, 2007 01:49 PM|LINK
Hi all,
I am New to asp.net Mobile.
I want to know how to align the asp.net mobile controls in the mobile forms in Design Time.I can drag the textbox,Button,labels Controls etc., but i cant align the Controls as i need.The Controls seems to be Locked,it cant moved in panels in forms.
Pls Help me.
jimmy q
All-Star
54108 Points
3578 Posts
Re: How to Align the Controls in Mobile Web Forms
Nov 21, 2007 07:07 PM|LINK
The mobile controls are quite limited when it comes to styling so they do not have support for things like alignment and cannot use HTML to set placements by using divs or tables. This is because alot of mobile devices do not support HTML and instead support other modes like WML, cHTML, xHTML etc.
If you want to do specific HTML/CSS rendering like using tables divs alignment etc you can add a deviceSpecific filter to your panel. The filter will be selected for isHTML and they you can do standard HTML development within its content template.
dj
Member
32 Points
7 Posts
Re: How to Align the Controls in Mobile Web Forms
Jan 22, 2008 01:08 AM|LINK
Hello all,
I am trying to left align my mobile controls and also make some links bold. Is it safe to assume that this won't work becuase of the limitations specified above? It shows up on my ie browser but when I look through phone emulators I have no luck.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MobileDynamic.aspx.cs" Inherits="Mobile_MobileDynamic" %> <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <html xmlns="http://www.w3.org/1999/xhtml" > <body> <mobile:Form id="frmMain" runat="server" Alignment="Left" Font-Name="notSet"> <mobile:Panel ID="Panel1" Runat="server" Alignment="Left"> <mobile:TextView runat="server" Font-Size="Large" id="txtTitle" Font-Bold="True" Alignment="Left"></mobile:TextView> <mobile:TextView runat="server" id="txtContentTop" Alignment="Left"/> <mobile:Link ID="mlTelNo" runat="server" Visible="false"></mobile:Link> <mobile:Link ID="mlHelpNo" runat="server" Visible="false"></mobile:Link> <mobile:TextView runat="server" id="txtContentBot" Alignment="Left"/> <mobile:List runat="server" id="mlLinks" OnItemCommand="Menu_OnItemCommand" DataTextField="LinkName" DataValueField="LinkPath" Alignment="Left"/> <mobile:List runat="server" id="mlLinksHeader" OnItemCommand="Menu_OnItemCommand" DataTextField="LinkName" DataValueField="LinkPath" Font-Bold="True" Alignment="Left" Font-Size="Large"/> <mobile:TextView runat="server" id="lblNotice" Alignment="Left"/> </mobile:Panel> </mobile:Form> </body> </html>mm_mobile
Member
1 Points
8 Posts
Re: How to Align the Controls in Mobile Web Forms
Jan 22, 2008 03:35 AM|LINK
Hi Dj,
For HTML browsers [like PocketPC's,some models in Samsung,Motorola etc.,] mobile controls can be aligned by integrating the other control like GridView and DataGrid [Takes some more code but alignment is good].But when we are looking for WML devices,Alignment is Poor,b'coz it will not support GridView or DataGrid.My Choice is use List,Selection List and Link in WML devices.Beyond the Feel and Look, User Interaction needs more care.
Here's some Snippet:
<
Choice Filter="IsHTML32" Xmlns="http://schemas.microsoft.com/mobile/html32template"> <ContentTemplate><
asp:Label ID ="test" Runat ="server" Text="Test" ></asp:Label> <asp:GridView ID="GridView1" runat="server" <Columns> <asp:TemplateField> <HeaderTemplate>Message</HeaderTemplate> <ItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CommandName="DataBind" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Date") %>' Width="104px"></asp:LinkButton> <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Message" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Message") %>' Width="104px"></asp:LinkButton> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView><mobile:Label ID="lblProblems" Runat="server" BackColor="ControlLightLight" ForeColor="DimGray" Alignment="Left">Problems with the application?</mobile:Label>
</ContentTemplate>
</Choice>Hope it will give an Idea.
DeanEwalt
Member
2 Points
3 Posts
Re: How to Align the Controls in Mobile Web Forms
Jan 23, 2008 10:06 PM|LINK
Error message in Visual Studio 2008 RTM says
EDITING OF MOBILE CONTROLS IS NOT SUPPORTED IN THE DESIGNER
Am I wasting my time trying to create a Mobile Form Website for PDA's ??!
mm_mobile
Member
1 Points
8 Posts
Re: How to Align the Controls in Mobile Web Forms
Jan 24, 2008 03:07 AM|LINK
Hi,
I cant get you !
Editing the mobile control in the sense, Making use of the control in the class file, Right.
like in Form1.aspx.cs [for c#] & Form1.aspx.vb [for vb]
if it so, Assign with an Control Object.
Snippet:
Control CtrlTextBox = Panel.Controls[0].FindControl("TextBox");System.Web.UI.MobileControls.
Command TextBox = (System.Web.UI.MobileControls.Command)CtrlTextBox;TextBox.Text="String";
at3_0506
Member
18 Points
51 Posts
Re: How to Align the Controls in Mobile Web Forms
Oct 27, 2008 12:49 PM|LINK
Mobile controls have limited functionality.. I agree, it is hard to align controls in mobile applications compared to a normal asp.net website.
From my experience, I align my controls by setting the properties of the specific control..and in the ALIGNMENT property, you can choose to align your controls
left, center, or right.
kinishodhan
Member
34 Points
14 Posts
Re: How to Align the Controls in Mobile Web Forms
Dec 06, 2008 05:39 AM|LINK
Hi ,
I have one question. How can i align 2 command control horizontally.
2 buttons are there Next and previous. I want to place this two buttons in the same line. how can i achieve this issue.
stockstorm
Member
13 Points
27 Posts
Re: How to Align the Controls in Mobile Web Forms
Feb 20, 2009 04:48 AM|LINK
I see the above that you used asp controls in the mobile web form. I'm not sure how the datagrid control/grid view works. Can you explain to me?