Fix breaking changes
This commit is contained in:
parent
e3458ceb1b
commit
3382b82e5e
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetlitedev/api/v2" />
|
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetlitedev/api/v2" />
|
||||||
|
|
|
||||||
|
|
@ -221,8 +221,8 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
{
|
{
|
||||||
var nullOptionTag = new TagBuilder("option");
|
var nullOptionTag = new TagBuilder("option");
|
||||||
nullOptionTag.Attributes["value"] = string.Empty;
|
nullOptionTag.Attributes["value"] = string.Empty;
|
||||||
nullOptionTag.SetInnerText(nullOption);
|
nullOptionTag.InnerHtml.SetContent(nullOption);
|
||||||
tag.InnerHtml = nullOptionTag;
|
tag.InnerHtml.SetContent(nullOptionTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
var clientValidators = html.GetClientValidationRules(metadata, null);
|
var clientValidators = html.GetClientValidationRules(metadata, null);
|
||||||
|
|
@ -269,19 +269,19 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
if (string.Equals(validator.ValidationType, "required"))
|
if (string.Equals(validator.ValidationType, "required"))
|
||||||
{
|
{
|
||||||
tag.Attributes["ng-show"] = string.Format("({0}.submitAttempted || {0}.{1}.$dirty || {0}.{1}.visited) && {0}.{1}.$error.{2}", formName, modelName, "required");
|
tag.Attributes["ng-show"] = string.Format("({0}.submitAttempted || {0}.{1}.$dirty || {0}.{1}.visited) && {0}.{1}.$error.{2}", formName, modelName, "required");
|
||||||
tag.SetInnerText(validator.ErrorMessage);
|
tag.InnerHtml.SetContent(validator.ErrorMessage);
|
||||||
}
|
}
|
||||||
else if (string.Equals(validator.ValidationType, "length"))
|
else if (string.Equals(validator.ValidationType, "length"))
|
||||||
{
|
{
|
||||||
tag.Attributes["ng-show"] = string.Format("({0}.submitAttempted || {0}.{1}.$dirty || {0}.{1}.visited) && ({0}.{1}.$error.minlength || {0}.{1}.$error.maxlength)",
|
tag.Attributes["ng-show"] = string.Format("({0}.submitAttempted || {0}.{1}.$dirty || {0}.{1}.visited) && ({0}.{1}.$error.minlength || {0}.{1}.$error.maxlength)",
|
||||||
formName, modelName);
|
formName, modelName);
|
||||||
tag.SetInnerText(validator.ErrorMessage);
|
tag.InnerHtml.SetContent(validator.ErrorMessage);
|
||||||
}
|
}
|
||||||
else if (string.Equals(validator.ValidationType, "range"))
|
else if (string.Equals(validator.ValidationType, "range"))
|
||||||
{
|
{
|
||||||
tag.Attributes["ng-show"] = string.Format("({0}.submitAttempted || {0}.{1}.$dirty || {0}.{1}.visited) && ({0}.{1}.$error.min || {0}.{1}.$error.max)",
|
tag.Attributes["ng-show"] = string.Format("({0}.submitAttempted || {0}.{1}.$dirty || {0}.{1}.visited) && ({0}.{1}.$error.min || {0}.{1}.$error.max)",
|
||||||
formName, modelName);
|
formName, modelName);
|
||||||
tag.SetInnerText(validator.ErrorMessage);
|
tag.InnerHtml.SetContent(validator.ErrorMessage);
|
||||||
}
|
}
|
||||||
// TODO: Regex, equalto, remote
|
// TODO: Regex, equalto, remote
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
|
|
||||||
var innerContent = data is JsonString ? data.ToString() : JsonConvert.SerializeObject(data);
|
var innerContent = data is JsonString ? data.ToString() : JsonConvert.SerializeObject(data);
|
||||||
innerContent.Replace("<", "\u003C").Replace(">", "\u003E");
|
innerContent.Replace("<", "\u003C").Replace(">", "\u003E");
|
||||||
builder.InnerHtml = new HtmlString(innerContent);
|
builder.InnerHtml.SetContentEncoded(innerContent);
|
||||||
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue