什麼是我們應該用於Dictionary屬性的內聯語法?ASP.NET reCaptcha CustomTranslations內聯語法
<recaptcha:RecaptchaControl ID="recap" CustomTranslations="string, string" Runat="server"/>
我知道這可以通過編程來實現,但是我希望不要。
什麼是我們應該用於Dictionary屬性的內聯語法?ASP.NET reCaptcha CustomTranslations內聯語法
<recaptcha:RecaptchaControl ID="recap" CustomTranslations="string, string" Runat="server"/>
我知道這可以通過編程來實現,但是我希望不要。
經過一天的努力,我通過Json .NET框架使用反序列化方法來定製reCaptcha。
using System.Web.Script.Serialization;
[類別( 「外觀」)]
[默認值(空)]
公共字符串CustomTranslations
{
get { return new JavaScriptSerializer().Serialize((object)this.customTranslations); }
set { this.customTranslations = new JavaScriptSerializer().Deserialize<Dictionary<string, string>>(String.Concat("{", value, "}")); }
}