| |

VerySource

 Forgot password?
 Register
Search
View: 679|Reply: 5

N9, N9, depressed !!! Adding an element to the DataList prompts an error ~~

[Copy link]

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-2-1 12:20:01
| Show all posts |Read mode
<asp: DataList ID = "showList" runat = "server" EnableViewState = "false" RepeatDirection = "horizontal"
                                    ItemStyle-Height = "100px" ItemStyle-Width = "50px" ItemStyle-BorderWidth = "1px">
                                    <ItemTemplate>
                                        &nbsp;
                                        <a href ='<%# DataBinder.Eval(Container.Item,"picUrl") %>? picid = <% # DataBinder.Eval (Container.Item, "picID")%> '>
                                            <asp: Image ID = "picture" runat = "server" ImageUrl = '<% # DataBinder.Eval (Container.Item, "smallUrl")%>' />
                                        </a>
                                    </ ItemTemplate>
                                </ asp: DataList>

Prompt error: "System.Web.UI.WebControls.DataListItem" does not contain the definition of "Item"

What's going on, the elements can be defined in the DataList! !! !! Woo ... wow ...
Reply

Use magic Report

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-3-13 12:45:02
| Show all posts
Brothers, come on top, almost depressed!
Reply

Use magic Report

0

Threads

64

Posts

45.00

Credits

Newbie

Rank: 1

Credits
45.00

 China

Post time: 2020-3-13 15:30:01
| Show all posts
Is it the front desk or the back desk?
Reply

Use magic Report

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-3-13 19:15:01
| Show all posts
The front desk, the edited page is wrong, and the prompt says: Error 1 "System.Web.UI.WebControls.DataListItem" does not contain the definition of "Item" D:\asp.net\source\chp16\OfficeAuto\ShowPic.aspx 28
Reply

Use magic Report

0

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-3-14 13:15:01
| Show all posts
<% # DataBinder.Eval (Container.Item, "picUrl")%>? Picid = <% # DataBinder.Eval (Container.Item, "picID")%>
Reply

Use magic Report

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-3-14 18:15:01
| Show all posts
Thank you brothers, the problem has been solved now, Container.DataItem is right, Container has no Item element !!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list