Newie question.

  • Thread starter Thread starter Guoqi Zheng
  • Start date Start date
G

Guoqi Zheng

I just found out that I sent out an uncomplete email(click wrong) , please
ignore my previous email

This is probably a very simple question, I just can not find the answer, I
am very new to ASP.NET.

I have the following in my repeater control.

<b
<%#Container.DataItem("ArticleContent")%> ...
<br>

What I want to do is a function which will get something from database based
on the value in container.Dateitem. For example I have

<b
<%#ShowContent(Container.DataItem("ArticleId"))%> ...
<br>

Then I have the function of ShowContent as
Function ShowContent(ByVal ArticleId as Integer)
' connect to database...
Return ArticleContent
End Function

Of course, the above code doesn't work, there should be something else for
line
<%#ShowContent(Container.DataItem("ArticleId"))%>

Can some one tell me what can I do for that line??

--
Met vriendelijke groet,

Guoqi Zheng
Tel: +31 (0) 23 5407422
Mob: 0648252520
http://www.meetholland.com
 
This may help:
<%#ShowContent(DataBinder.Eval(Container.DataItem, "ArticleID")) %>

Of course having this line assumes that you are binding to some source that
provides the value of ArticleID. This would work if the line above appears -
for example - in a <table> that is in an ItemTemplate for a DataReader
control - and that DataReader control is bound to a DataSet that contains
ArticleID. At least this would be one way to get the value for ArticleID at
runtime - which appears to be the issue you need to solve.

HTH.

-Jeff
 
Back
Top