Professional Web Applications Themes

can't write <% # in VS.NET - ASP.NET General

Hi, what I want to do is simple, output a image whose URL is composed from a field from a database. the picture is shown in a Datagrid. <ItemTemplate> <img src="<%# databinder.eval(container.dataitem,"id")%>.jpg"> </ItemTemplate> I am using VS.NET, the problem is it doesn't allow using <%, or u can not switch to design mode after u write in HTML mode. But I can't do that with Property dialog of the datagrid object in VS.NET, can anybody tell me how could I do that in VS.NET design window? Thanx Nakhi...

  1. #1

    Default can't write <% # in VS.NET

    Hi,
    what I want to do is simple, output a image whose URL is composed from a
    field from a database.

    the picture is shown in a Datagrid.

    <ItemTemplate>
    <img src="<%# databinder.eval(container.dataitem,"id")%>.jpg">
    </ItemTemplate>

    I am using VS.NET, the problem is it doesn't allow using <%, or u can not
    switch to design mode after u write in HTML mode.

    But I can't do that with Property dialog of the datagrid object in VS.NET,
    can anybody tell me how could I do that in VS.NET design window?

    Thanx
    Nakhi


    nakhi Guest

  2. #2

    Default Re: can't write <% # in VS.NET

    use this instead
    <img src='<%# databinder.eval(container.dataitem,"id")%>.jpg'>

    pls note the single quote.

    "nakhi" <com> wrote in message
    news:phx.gbl... 


    Dai Guest

  3. #3

    Default Re: can't write <% # in VS.NET

    Please get back to us whether the change to double quote works
    Can someone also explain why is it changing to double quote works and not
    single quotes

    Cheers

    J

    "Dai Hao" <com> wrote in message
    news:phx.gbl... [/ref]
    not [/ref]
    VS.NET, 
    >
    >[/ref]


    James Guest

  4. #4

    Default Re: can't write <% # in VS.NET

    Double double quotes don't work because it would be a string within a
    string. This is something the pr should deal with but doesn't. I think
    this does work at runtime in most cases, but at designtime VS's visual
    editor can't deal with it because it's essentially nested strings.

    +++ Rick --

    --

    Rick Strahl
    West Wind Technologies
    http://www.west-wind.com/
    http://www.west-wind.com/wwHelp
    ----------------------------------
    Making waves on the Web


    "James Zhuo" <com.au> wrote in message
    news:phx.gbl... [/ref][/ref]
    a [/ref]
    > not [/ref]
    > VS.NET, 
    > >
    > >[/ref]
    >
    >[/ref]


    Rick Guest

Similar Threads

  1. Replies: 2
    Last Post: June 1st, 08:38 PM
  2. How to write URL wit #
    By Jacek Ross in forum Macromedia Flash
    Replies: 0
    Last Post: September 2nd, 07:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139