On submit click getting issue in umbraco

女生的网名这么多〃 提交于 2020-01-07 02:45:06

问题


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

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

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
  {


  }
}

回答1:


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/




回答2:


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>


来源:https://stackoverflow.com/questions/40409421/on-submit-click-getting-issue-in-umbraco

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!