could anybody help to solve my problem in asp.net i have used datagrid template column in asp.net, i have one function in code behind to return some string value, i want to display funtion retruned value to the datagrid template column label,this is method i have in my application, function string retvalue() { string testvalue="Monday/Thursday/Friday"; if (testvalue.Equals("N/A")) { } else { string[] Loop=testvalue.Split('/'); int[] DayValue=new int[Loop.Length-1]; Test test=new Test(); DayValue[0]=0; for(int i=0;i<=Loop.Length-1;i++) { int Retvalue=test.Format(Loop.ToString().Trim()); if(DayValue[0]==0) { DayValue[0]=Retvalue; } else { if(DayValue[0] > Retvalue) { DayValue[0]=Retvalue; } } } } label1.Text=System.DateTime.Now.AddDays(DayValue[0]).ToShortDateString(); return label1.Text; } i want display the return value to datagrid template column, please kindly tell the syntax ,please anybody help to solve this problem
It would look something like this... <ItemTemplate> <asp:Label ID="Label2" runat="server"><%# retvalue() %></asp:Label> </ItemTemplate> Code (markup):