i am begginer

Britches

New Member
I found this code from asp.net.<BR>can some one explain what does "title-{0}.gif" mean<BR>and i was wondering about price too..<BR><BR>can anyone explain me how does it work.<BR>thanks a lot<BR><BR><BR><td><BR><img src=http://aspmessageboard.com/archive/index.php/'<%# DataBinder.Eval(Container.DataItem, "title_id", "/quickstart/aspplus/images/title-{0}.gif") %>'><BR></td><BR><BR><td width=250 valign=top><BR><BR><b><%# DataBinder.Eval(Container.DataItem, "title") %></b><BR><BR><BR><BR><BR><BR>Price: <%# DataBinder.Eval(Container.DataItem, "price", "${0}") %><BR></td><BR>First of all anything in between these code blocks <%# %> get binded when the Page.DataBind() method is called, or when control's DataBind method is called.<BR>Next DataBinder.Eval() is a function which "evaluates" the type of data and binds it correctly to the property of the control.<BR>DataBinder.Eval() accepts 1 or 2 parameters.<BR>The first parameter is the name of the Column which in this case is "title_id".<BR>The second optional parameter accepts a string with the place holder {0} inside of it. When the data is binded to the control the value of the "title_id" replaces the place holder {0}.<BR><BR>If you leave the second parameter out as in:<BR><%# DataBinder.Eval(Container.DataItem, "ProductName") %><BR>Then the data is just binded to the property of the control.<BR><BR>You might want look at this page:<BR>http://www.dotnetjunkies.com/QuickStart/aspplus/default.aspx?url=/quickstart/aspplus/doc/webformssyntaxref.aspx<BR><BR>Aaron<BR><BR>thanks for explaining very clearly and its a very quick response too.<BR><BR>Good work.
 
Back
Top