Rafael del Corr...'s profile..:: Blog de Rafael del ...BlogLists Tools Help

Blog


    Containers

    As I said in the previous post, we are going to see each control specifically. The first of all controls there will be those that make possible to contain other controls: the “Forms” and the “Panels”. If we are accustomed to work with ASP.NET Desktop WebSites (standards ASP.NET pages) we know that a page can only contain one form control.

    And here there is a great advantage if we make it work properly: ASP.NET allows us to include more than one form in one page. If you bear in mind that a request from a mobile device it is expensive compare with a standard ASP.NET page request, the possibility of having two forms in one page, and being able to call one form at a time (writing “#” followed by the name of a form in a Link control in the Action property or through the ActiveForm property through the server code) will allow us to improve the quality (speed and cost) of our site.

    An other advantage of this functionality is that the variables continue existing between a call of a form to an other, since ASP.NET does not keep the variables state between different pages (ASP.NET standard). The functions and methods developed for the page are available for all forms.

    The problem with this functionality, is that if the page is plenty of forms, it will take more time to download it to the mobile device, and the page is reached by one URL, and this URL always point to the first form.

    This functionality is inherited from WML that works with “cards” instead of forms, but in the same way, to explain it quickly.

    There are some rules to work with the forms and the panels. They are:

    -          A form can not contain another form.

    -          A panel can not contain a form.

    -          The panels are able to have one or more panels inside them.

    -          A panel must exists inside a form, like any control.

    The forms, apart from having the common WMC´s properties and events, has their own. For now, we are going to see:

    Title
    Set the title of the page. This make easily and more effectively the search for the seekers.

    Paginate
    Not all devices are prepared to receive an entire page due to it low memory capacity. To avoid this, ASP.NET automatically separates a form in several steps. By default this property is set as “False”, so if we are navigating in a low memory capacity device and appears a message like “Out of memory”, we know de reason why. About pagination, there are two more properties: CurrentPage (returns the page where “we” are visiting) and PageCount (quantity of pages that the forms was separated in)

    Action
    Set  an alternative URL to where the page could be redirectioned. By default this property is set as Null, so, it will do a postback to the same page.

    ControlToPaginate
    This property allows to specify a certain control, that want to be paginated. It must be defined de control´s ID, and by default is Null.

    PagerStyle-NextPageText or PagerStyle-PreviousPageText
    In the majority of the browsers appears two buttons that allows us to move forward or towards through the different pages that we visited. In case that a browser has not this controls, ASP.NET automatically includes it. So, this properties allows the developer to specify the text of this buttons.

    PagerStyle-PageLabel
    Sets or gets the text that indicates to what page the user may go, for example “Go to page {2} of {3}”. This is the way to specify. This property is not available in devices that only support WML.

    PagerStyle-StyleReference
    This property sets or gets the style that is used to render de pagination of the page, in case that “Paginate” is set as true of course. This property is not available in WML devices neither.

    You can download an example from here.

    In the other hand, continue talking about “containers” we must name the “Panels”. This controls has not a visual interface, and its principal function is to group controls so that the developer can assign a certain value to a common property between the controls contained in the panel.

    Apart from having the common properties of the WMC´s, the panels has their own properties, and they are:

    Paginate
    It has a similar function to the form one. It allows to establish the panel as a non “step-divided” control (True or False). For example. If the property “Paginate” of the form that contains the panel is set as “True”, the ASP.NET engine will try to keep the controls inside the panel together, not to divide them in several steps or pages.

    StyleReference
    Allows to set a certain style for the panel.

    In the example that you can download above you can see how a panel can contain other controls. Try creating other controls inside a panel, changing a common property between them, and you will see how it changes for all of them.

    I hope that you find of your interest this article, and we are seeing in the next post, where I will continue talking about the ASP.NET Web Mobile Controls.

    Good Luck!

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://mobiledevp.spaces.live.com/blog/cns!B1F45CF18768D48A!119.trak
    Weblogs that reference this entry
    • None