|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Store Value from Data RepeaterI'm using a data repeater to get ID values from a simple table in my
database and display them on my .aspx page (this is working): <ItemTemplate> <tr> .... <td><%# DataBinder.Eval(Container, "DataItem.MyID") %></td> .... <tr> </ItemTemplate> Now, I want to be able to store the value I get from DataBinder.Eval(...) into a string and call a function in my code behind (from within the .aspx page, passing that string). Is this possible? I'm a newbie to ASP.NET, ADO.NET and C#, so any help would be greatly appreciated! Thanks! Christine Okay, I figured it out. I can just use that same DataBinder line as an
argument to my code-behind function, so I would have something like: ****.aspx page**** .... <td><%# DataBinder.Eval(Container, "DataItem.MyID") %></td> <td><%# GetUserName((string)DataBinder.Eval(Container, "DataItem.MyID")) %></td> .... ****c# code behind**** protected string GetUserName(string ID) { ... } NOTE: I had to cast the argument as a string in order to get the call to work. Christine |
|||||||||||||||||||||||