javascript - MVC builds html page but does not show it -


i have problem concerning asp.net mvc.

i have index.cshtml page following javascript

      $('#employeetable tbody').on('dblclick', 'tr', function() {             var mitarbeiterid = table.row(this).data().id;                             $.post('@url.action("indexcompletion")', { id: mitarbeiterid });         }); 

this gets me id of employee , calls actionresult in controller

    [httppost]     public actionresult indexcompletion(int id)     {         mitarbeiter ma = new leistungserfassungservice.leistungserfassungservice().getmitarbeiterbyid(id);         return view("indexcompletion", new indexcompletionviewmodel{mitarbeiter = ma});     } 

now hoped show me following page:

    @model leistungserfassung.models.indexcompletionviewmodel      @{        viewbag.title = "completion";        layout = "~/views/shared/_layout.cshtml";    }     <div class="content">        <h2>completion</h2>        @model.mitarbeiter.nachname    </div> 

but happens is, builds page successfully, can see on networking tab in google chromes dev tools, not redirect it. when directly try navigate .cshtml file, browser tells me can not found.

does have idea of problem on this? new javascript grateful advice!

thanks in advance , sorry german parts in code.

you're making async ajax call server using javascript means javascript needs redirect user page. so, in order happen controller post method should return response javascript (most json) have redirect link (key, value) item redirect.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -