@Html.TextBoxFor(model => model.TagKeyWord, new { @class = "text", @style = "width:98%", @id = "seotagkeyword", onkeyup = "counttagkeyword(this);" })
<script type="text/javascript">
function counttagkeyword() {
debugger;
var area = document.getElementById("seotagkeyword").value;
var count = (area.match(/,/g) || []).length;
alert(count);
}
</script>
In C#
______________________________
string character = model.TagKeyWord;
int count = character.Count(x => x == ',');
<script type="text/javascript">
function counttagkeyword() {
debugger;
var area = document.getElementById("seotagkeyword").value;
var count = (area.match(/,/g) || []).length;
alert(count);
}
</script>
In C#
______________________________
string character = model.TagKeyWord;
int count = character.Count(x => x == ',');
No comments:
Post a Comment