<script type="text/javascript"> $(document).ready(function () { var oldCell; var oldText; $("td.tdTime").hover( function () { oldCell = $(this).children(".rotate"); var cell = $(this).children(".rotate"); oldText = cell.text(); cell.text('Удалить!'); }, function () { oldCell.text(oldText); }); }); function deleteDay(tdObj) { td = $(tdObj); var idZanyatiya = td.attr('id'); $.ajax({ method: "POST", url: "DeleteDay", data: { Facultet_ID: Facultet_ID, Gruppa_ID: Gruppa_ID, Disciplina_ID: Disciplina_ID, PrepodID: Prepod_ID, IDZanyatiya: idZanyatiya } }); } 

  @foreach (BRSGSTOU.Models.tableZanyatiy z in ViewBag.ChisloZanyatiy) { if (Gruppa_ID == z.ID_Gruppi.ToString() && Disciplina_ID == z.ID_Disciplini.ToString()) { <td id="@z.ID" onclick="deleteDay(this)" class="tdTime" style="max-height:80px;padding-top:65px; padding-bottom:5px;"> <div class="rotate">@z.Vremya.ToString("d")</div> </td> } } 

Closed due to the fact that off-topic participants Grundy , Alex , user194374, Denis Bubnov , Bald 13 Dec '16 at 3:56 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Alex, Community Spirit, Denis Bubnov, Bald
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    error on the client or on the server? - Igor
  • error on the client - Vivus
  • There is nothing in the question code that can cause such an error. Where do the variables Facultet_ID , Gruppa_ID and others come from? - Igor
  • These are C # variables with their values. They are not empty. I checked - Vivus
  • one
    Where does C # variables in the javascript line of data: { Facultet_ID: Facultet_ID, ... come from? - Igor

1 answer 1

Where do C # variables from the javascript line of data: {Facultet_ID: Facultet_ID, ...? Igor

Thought they convey meanings. Created js variables and assigned them C # variable values. It all worked!