Hi,
I have a table called contract, has following fields
Id(uniqueidentifier),contractno(int), personname(varchar(50)),NationalityId(fk,uniqueidentifier),
OccupationId(FK,uniqueidentifier), SalaryId(fk,Uniqueidentifier).
Salary has been defined in the salarydetails table with the following fields based on occupation and nationality
Id(pk,unique identifier),OccupationId(fkuniqueidentifier,ud),NationalityId(fk,uniqueidentifier),salary(int)
I am using asp.net mvc to create a contract, which is working fine
but the problem is in edit, which loads the data, but while saving salary id is missing, so model.isvalid is becomes false
The code in the view is given below
<div class="editor-field">
@Html.TextBoxFor(model => model.SalaryDetail.Salary)
@Html.ValidationMessageFor(model => model.SalaryId)
</div>
Instead of salarydetail.salary, if I put SalaryId then the edit form loads the id instead of salary value from the table, in the case its working but i supposed to display the salary not the id
Your help will be much appreciated.
[Edit]Code block added[/Edit]