2014年7月13日 星期日

[RESOLVED] Adding 2 values to a row in Repeater


I'm trying to fill a row in a repeater with a date range.


The Column are :  StartDate, End Date


How would I put these values into a range using C#.


Something like


"StartDate" & "-" & "EndDate" 


The Line I want to replace is the 2nd <%#Eval("LastName:) %> Line.  I just put that one there for a placeholder.



Here is a copy of the code for the repeater so far:





<%--Request Form ID--%>
Submit Date
Employee ID
First Name
Last Name
Date Range




" class="requestFormRow">
<%-- --%>
<%#Eval("SubmitDate"," {0:MM/dd/yyyy}") %>
<%#Eval("EmployeeID") %>
<%#Eval("FirstName") %>
<%#Eval("LastName") %>
<%#Eval("LastName") %>




Thanks for any help


JS





Try this,


<%# Eval("StartDate") + "-" + Eval("EndDate") %>


I had to add the format since the time is included in the DB.  But yours was definately what I was looking for. 


Although I already had the basic idea.  

THANK YOU!


 Here's the finished product:


<%# Eval("StartDate"," {0:MM/dd/yyyy}") + "-" + Eval("EndDate"," {0:MM/dd/yyyy}") %>




沒有留言:

張貼留言