| Rafael del Corr...'s profile..:: Blog de Rafael del ...BlogLists | Help |
Text ControlsWe have three type of “Text Controls” inside the WMC´s: the LiteralText, Label and TextView control. Each one, has their functionalities. Some of them admit HTML labels, some can alternate their behaviors through server code, etc. This is what we are going to see in this article, in order according to their functionalities: First of all we have the LiteralText. Though is not a WMC, it is a class that inherits from MobileControl and represent all kind of text that we want to make visible to the user and we do not want to control from the server. This text allows to use some labels similar to HTML ones. For example, we can use: - Paragraph labels (<p></p>) - Font style labels (black and italic) (<b></b> and <i></i>) - Line feed labels (<br> or </br>) - Link labels (<a href=”url”></a>) This labels will be processed according to the language that the device that make the request supports. And here we have an example of a literal text using all the supported labels: <html xmlns="http://www.w3.org/1999/xhtml" > </mobile:Form> The ASP.NET engine will render the page code according to the device that make the request (HTML, WML, etc.). In second place: the Label control. This is a WMC and it behavior could be modified from the server code side. This control, apart from the common properties has a new one: “Text”. This property allows us to change the text value of the label, and could be modified in any time. In this type of controls you are not able to use HTML labels as in the case of the LiteralText control. There are two possibles sintax to set the text value of a label: a) Between the labels <mobile:Form id="Form1" runat="server"> b) Modifying the Text property <mobile:Form id="Form1" runat="server"> Something to bear in mind is that a label can not be paginated. This is not the same for our third text control: the TextView. This controls has the common properties and it is added Text, that satisfies the same necessity that the case of a Label control. But if you are wondering what is the difference between the Labels and the TextView, the answer is that this control allows to, for example, bind data with a database. We should use this control, for all those texts that, storing it in a database requires a Memo or Text field type. In this control, we can use the same HTML labels that we can use in the LiteralText, added to all the rest of the HTML labels (always respecting the type of labels permitted according with what we see in the second post of this blog). Apart from the modifications that this labels permit, we are able to use the common properties as any control (Font.Bold, Font.Italic, etc.) An other very important feature of this control, as we said, is that it could be “paginated”. This is very useful in the case that we are navigating with a low memory capacity device and the text is too long for it to support it. In this case, we must “turn on” the property that allows the pagination (Paginate=”True”) Here we have an example: <mobile:Form id="Form1" runat="server"> Well, that´s it all for now. We are seeing in the next post with those controls that allows as to go and came back to the server, to another page, etc.: Image, Link and Command, their common properties, their owned properties and events, and how, mixing these we can get more functionalities. See you!! TrackbacksThe trackback URL for this entry is: http://mobiledevp.spaces.live.com/blog/cns!B1F45CF18768D48A!122.trak Weblogs that reference this entry
|
|
|