Click here to Skip to main content
15,860,859 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: FireFox Upload Images Pin
Richard Deeming6-Sep-20 23:09
mveRichard Deeming6-Sep-20 23:09 
GeneralRe: FireFox Upload Images Pin
Member 1054897717-Sep-20 5:31
Member 1054897717-Sep-20 5:31 
GeneralRe: FireFox Upload Images Pin
Richard Deeming17-Sep-20 9:06
mveRichard Deeming17-Sep-20 9:06 
GeneralRe: FireFox Upload Images Pin
Member 1054897718-Sep-20 5:48
Member 1054897718-Sep-20 5:48 
GeneralRe: FireFox Upload Images Pin
Richard Deeming20-Sep-20 23:40
mveRichard Deeming20-Sep-20 23:40 
GeneralRe: FireFox Upload Images Pin
Member 1054897717-Sep-20 5:36
Member 1054897717-Sep-20 5:36 
GeneralRe: FireFox Upload Images Pin
Member 1054897718-Sep-20 5:29
Member 1054897718-Sep-20 5:29 
QuestionShow DataTable in Json Pin
Member 149089644-Sep-20 0:20
Member 149089644-Sep-20 0:20 
Hi,
I need help for show datatable in Json

My project is MVC:

My AgendaModel

C#
<pre>        public List<AgendaModel> MostrarTodosCalendar()
        {
            List<AgendaModel> lista = new List<AgendaModel>();
            AgendaModel item;
            DAL objDAL = new DAL();
            string sql = "SELECT id, title, start, end, AllDay, Color, TextColor FROM agenda";
            DataTable dt = objDAL.RetDataTable(sql);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                item = new AgendaModel
                {

                    Id = dt.Rows[i]["Id"].ToString(),
                    Title = dt.Rows[i]["Title"].ToString(),
                    Start = dt.Rows[i]["Start"].ToString(),
                    End = dt.Rows[i]["End"].ToString(),
                    //AllDay = dt.Rows[i]["Allday"].ToString(),
                    Color = dt.Rows[i]["Color"].ToString(),
                    TextColor = dt.Rows[i]["TextColor"].ToString()

                };

                lista.Add(item);
            }

            return lista;
        }



My View: Index:

function CriarEventosCalendario() {

       var events = [];


       @{
           foreach(var item in (List<AgendaModel>)ViewBag.ListaEventos)
                  {<text>events.push({
                    'id': @item.Id,
                    'title': '@item.Title',
                    'start': '@item.Start',
                    'end': '@item.End',
                    'allDay': false,
                    'color': '@item.Color',
                    'textColor': '@item.TextColor'
                  });</text>

           }

       }


I want to convert to JSON because fullcalendar is not showing the data as it currently is.

AnswerRe: Show DataTable in Json Pin
F-ES Sitecore4-Sep-20 2:43
professionalF-ES Sitecore4-Sep-20 2:43 
GeneralRe: Show DataTable in Json Pin
Member 1490896421-Sep-20 1:48
Member 1490896421-Sep-20 1:48 
GeneralRe: Show DataTable in Json Pin
F-ES Sitecore21-Sep-20 1:51
professionalF-ES Sitecore21-Sep-20 1:51 
GeneralRe: Show DataTable in Json Pin
Member 1490896421-Sep-20 3:47
Member 1490896421-Sep-20 3:47 
GeneralRe: Show DataTable in Json Pin
Richard Deeming21-Sep-20 4:20
mveRichard Deeming21-Sep-20 4:20 
QuestionHotel ERP system Pin
Member 1492170724-Aug-20 4:36
Member 1492170724-Aug-20 4:36 
AnswerRe: Hotel ERP system Pin
Richard Deeming24-Aug-20 4:52
mveRichard Deeming24-Aug-20 4:52 
AnswerRe: Hotel ERP system Pin
Mycroft Holmes24-Aug-20 12:22
professionalMycroft Holmes24-Aug-20 12:22 
GeneralRe: Hotel ERP system Pin
CHill604-Sep-20 0:37
mveCHill604-Sep-20 0:37 
AnswerRe: Hotel ERP system Pin
Eddy Vluggen24-Aug-20 12:39
professionalEddy Vluggen24-Aug-20 12:39 
Question.Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx19-Aug-20 8:39
professionaljkirkerx19-Aug-20 8:39 
AnswerRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx19-Aug-20 10:04
professionaljkirkerx19-Aug-20 10:04 
AnswerRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
Richard Deeming19-Aug-20 21:58
mveRichard Deeming19-Aug-20 21:58 
GeneralRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx20-Aug-20 4:33
professionaljkirkerx20-Aug-20 4:33 
GeneralRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx21-Aug-20 9:43
professionaljkirkerx21-Aug-20 9:43 
Questionsubmit button Pin
Member 1491014318-Aug-20 23:40
Member 1491014318-Aug-20 23:40 
SuggestionRe: submit button Pin
Richard MacCutchan19-Aug-20 0:16
mveRichard MacCutchan19-Aug-20 0:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.