mobile controls in a "for" loop

Discussion in 'ASP .Net Mobile' started by SJ, Oct 9, 2006.

  1. SJ

    SJ Guest

    Hi,

    I'm trying to do something like the following:

    <mobile:Form Runat="server" id="Form1">
    <% for ( int i = 0 ; i < 4 ; i++ ) %>
    <% { %>
    <mobile:Image id="MyImage" ImageURL="test.png"
    Runat="server"></mobile:Image>
    <% } %>
    </mobile:Form>

    Essentially, trying to create a mobile Image within a for loop. But I keep
    getting the following compile error:

    Compilation Error
    Description: An error occurred during the compilation of a resource required
    to service this request. Please review the following specific error details
    and modify your source code appropriately.
    Compiler Error Message: CS1513: } expected
    Source Error:

    Line 110: #line default
    Line 111: #line hidden
    Line 112: }
    Line 113:
    Line 114: private System.Web.UI.Control __BuildControlmyImage() {
    Source File: c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET
    Files\testproject\826ef180\566fe267\zocq9yhr.0.cs Line: 112

    -------------------------------

    Line 105: private void
    __Render__control2(System.Web.UI.HtmlTextWriter __output,
    System.Web.UI.Control parameterContainer) {
    Line 106:
    Line 107: #line 11
    "http://localhost/TestProject/MobileWebForm2.aspx"
    Line 108: for(int i=0; i< list.Count;i++) {
    Line 109:
    Line 110: #line default
    Line 111: #line hidden
    Line 112: }
    Line 113:
    Line 114: private System.Web.UI.Control __BuildControlmyImage() {



    I don't see where i'm missing a curly brace.
    Are mobile controls restricted in the sense that they cannot be rendered in
    a loop? If I do the same thing with ASP.NET web controls, it works just
    fine.

    thanks,
    -SJ.
    SJ, Oct 9, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Zahoor
    Replies:
    1
    Views:
    794
    Darryl L. Pierce
    Nov 15, 2003
  2. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    Non "mobile" controls on Mobile ASPX

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Aug 17, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    651
    Steven Cheng[MSFT]
    Aug 20, 2007
  3. chen selina
    Replies:
    0
    Views:
    1,256
    chen selina
    Jul 13, 2010
  4. dawson
    Replies:
    0
    Views:
    158
    dawson
    Jul 12, 2005
  5. Isaac Won
    Replies:
    9
    Views:
    352
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page