Click here to Skip to main content
15,887,836 members

Comments by Member 11233046 (Top 11 by date)

Member 11233046 18-Nov-14 10:20am View    
Nathan Minier it´s working perfectly . . . I have no word to thank you . . . Man you saved my week. for now on I´m gonna programme and spend all my night . . .
Thank you Man
Member 11233046 18-Nov-14 9:55am View    
yeah there were some errors . . . I´m gonna ran it know and see it
Member 11233046 18-Nov-14 8:41am View    
allright hope you find out the big mistake I´m making . . .
Member 11233046 18-Nov-14 8:39am View    
the exception : Additional information: The model item passed into the dictionary is of type 'FarControl.Models.AddressModel', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[FarControl.Models.AddressModel]'.

Hope you get know
Member 11233046 18-Nov-14 8:32am View    
and the main View
@model FarControl.Models.AddressModel


@{
ViewBag.Title = "Index";
}

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$("#CountryId").change(function () {
var selectedItem = $(this).val();
var ddlStates = $("#StateId");
var statesProgress = $("#states-loading-progress");
statesProgress.show();
$.ajax({
cache: false,
type: "GET",
url: "@(Url.RouteUrl("GetStatesByCountryId"))",
data: { "countryId": selectedItem },
success: function (data) {
ddlStates.html('');
$.each(data, function (id, option) {
ddlStates.append($('<option></option>').val(option.id).html(option.name));
});
statesProgress.hide();
},
error: function (xhr, ajaxOptions, thrownError) {
alert('Failed to retrieve states.');
statesProgress.hide();
}
});
});
});
</script>

@Html.LabelFor(model => model.CountryId)
@Html.DropDownListFor(model => model.CountryId, Model.AvailableCountries)

<br />

@Html.LabelFor(model => model.StateId)
@Html.DropDownListFor(model => model.StateId, Model.AvailableStates)

<p>
// here I call the Razor Partial view
<div>
@Html.Partial("IndexStates" , Model.partialModel)

</div>
</p>

<span id="states-loading-progress" style="display: none;">Please wait..</span>