On submit click getting issue in umbraco

2019-09-14 00:38发布

I have one submit click on which the comment get submitted for particular product or thing but on clicking that I am not able to submit that commnet and facing issue as seen in below images enter image description here

enter image description here

Another thing is that this things are working properly in my local host but when I upload it on my beta/staging/Live server I am facing this issue. I have also tried deleting umbraco.config file and log file but still facing same issue

Also on log file I can see the issue as

enter image description here

I have one issue for what i assume both issue are interlink to each other Umbraco on save and publishing showing error

My controller code

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Net;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Web.Mvc;
using Newtonsoft.Json.Linq;
using umbraco;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Web.WebApi;
using xyz.Controls;
using System.Data.SqlClient;
using System.Net.Mail;

namespace xyz.Controllers
{
  public class CommentsController : UmbracoApiController
  {


  }
}

2条回答
Root(大扎)
2楼-- · 2019-09-14 01:25

The issue was resolved while going in to Machine.Config of sql server and updating the syntax as

<connectionStrings>
<remove name="LocalMySqlServer"/>
<add name="LocalMySqlServer" connectionString="Datasource=localhost;Database=users;uid=root;pwd=password;"
   providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
查看更多
一夜七次
3楼-- · 2019-09-14 01:33

None of the logs you are showing are error logs so it does not look like your code is logging the 500 error.

from what I can see, you have a method GetComment on the CommentsController that is failing server side. If you don't have a try catch wrapping the code in that method then you need to add that and log the error.

try
{
...Your method code here
}
catch (Exception ex)
{
LogHelper.Error(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, ex.Message, ex);
}

Upload your changes to the server and then run the page with the error. Hopefully you'll have an error message in the current log file in app_data/logs/

查看更多
登录 后发表回答