Click here to Skip to main content
15,798,825 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: FireFox Upload Images Pin
Richard Deeming7-Sep-20 0:09
mveRichard Deeming7-Sep-20 0:09 
GeneralRe: FireFox Upload Images Pin
Member 1054897717-Sep-20 6:31
Member 1054897717-Sep-20 6:31 
GeneralRe: FireFox Upload Images Pin
Richard Deeming17-Sep-20 10:06
mveRichard Deeming17-Sep-20 10:06 
GeneralRe: FireFox Upload Images Pin
Member 1054897718-Sep-20 6:48
Member 1054897718-Sep-20 6:48 
GeneralRe: FireFox Upload Images Pin
Richard Deeming21-Sep-20 0:40
mveRichard Deeming21-Sep-20 0:40 
GeneralRe: FireFox Upload Images Pin
Member 1054897717-Sep-20 6:36
Member 1054897717-Sep-20 6:36 
GeneralRe: FireFox Upload Images Pin
Member 1054897718-Sep-20 6:29
Member 1054897718-Sep-20 6:29 
QuestionShow DataTable in Json Pin
Member 149089644-Sep-20 1:20
Member 149089644-Sep-20 1: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 3:43
professionalF-ES Sitecore4-Sep-20 3:43 
GeneralRe: Show DataTable in Json Pin
Member 1490896421-Sep-20 2:48
Member 1490896421-Sep-20 2:48 
GeneralRe: Show DataTable in Json Pin
F-ES Sitecore21-Sep-20 2:51
professionalF-ES Sitecore21-Sep-20 2:51 
GeneralRe: Show DataTable in Json Pin
Member 1490896421-Sep-20 4:47
Member 1490896421-Sep-20 4:47 
GeneralRe: Show DataTable in Json Pin
Richard Deeming21-Sep-20 5:20
mveRichard Deeming21-Sep-20 5:20 
QuestionHotel ERP system Pin
Member 1492170724-Aug-20 5:36
Member 1492170724-Aug-20 5:36 
AnswerRe: Hotel ERP system Pin
Richard Deeming24-Aug-20 5:52
mveRichard Deeming24-Aug-20 5:52 
AnswerRe: Hotel ERP system Pin
Mycroft Holmes24-Aug-20 13:22
professionalMycroft Holmes24-Aug-20 13:22 
GeneralRe: Hotel ERP system Pin
CHill604-Sep-20 1:37
mveCHill604-Sep-20 1:37 
AnswerRe: Hotel ERP system Pin
Eddy Vluggen24-Aug-20 13:39
professionalEddy Vluggen24-Aug-20 13:39 
Question.Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx19-Aug-20 9:39
professionaljkirkerx19-Aug-20 9:39 
AnswerRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx19-Aug-20 11:04
professionaljkirkerx19-Aug-20 11:04 
AnswerRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
Richard Deeming19-Aug-20 22:58
mveRichard Deeming19-Aug-20 22:58 
GeneralRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx20-Aug-20 5:33
professionaljkirkerx20-Aug-20 5:33 
GeneralRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx21-Aug-20 10:43
professionaljkirkerx21-Aug-20 10:43 
Questionsubmit button Pin
Member 1491014319-Aug-20 0:40
Member 1491014319-Aug-20 0:40 
SuggestionRe: submit button Pin
Richard MacCutchan19-Aug-20 1:16
mveRichard MacCutchan19-Aug-20 1: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.