Hey guys, I'm doing an ASP.NET MVC project just for learning...and stuck in this...
I'm trying the get the value from the Html.TextBoxFor(model => model.ShortName)
and show in the side www.blablabla.com/Value
, it in the time of the user is typing.
I tried to add the AJAX library reference on the top:
<script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
<% Html.EnableClientValidation(); %>
Here goes the unsucceed code so far:
<div class="editor-label">
<%: Html.LabelFor(model => model.ShortName) %>
</div>
<div class="editor-field">
<%: Html.TextBoxFor(model => model.ShortName) %>
<%: Html.ValidationMessageFor(model => model.ShortName) %>
This will be the name used for your short address
www.blablabla.com/<%: Model == null || string.IsNullOrEmpty(Model.ShortName) ? "shortName" : Model.ShortName %>
</div>
Thanks in advance