Update multiple views and multiple clients in ASP.NET MVC (Razor) -
i using asp.net mvc 4 razor viewmodel. want implement signalr knockout. here code working perfectly.
i have requirement when task created should display clients, , should display client message on different view.
@model taskmanager.models.tasklist @{ viewbag.title = "create"; } <h2>create</h2> @using (html.beginform()) { @html.antiforgerytoken() @html.validationsummary(true) <fieldset> <legend>tasklist</legend> <div class="editor-label"> @html.labelfor(model => model.taskname) </div> <div class="editor-field"> @html.editorfor(model => model.taskname) @html.validationmessagefor(model => model.taskname) </div> <div class="editor-label"> @html.labelfor(model => model.taskdesc) </div> <div class="editor-field"> @html.textareafor(model => model.taskdesc) @html.validationmessagefor(model => model.taskdesc) </div> <p> <input type="submit" value="create" /> </p> </fieldset> } <div> @html.actionlink("back list", "index") </div> @section scripts { @scripts.render("~/bundles/jqueryval") }
you may not familiar how signalr works sounds homework assignment. forgive me if mistaken.
to start off, please read wiki on signalr: http://www.asp.net/signalr also, spend little bit of time going through tutorials on knockout: http://learn.knockoutjs.com/. adjusted , familiar how both technologies work , capable of.
once ready jump in, want set server-side hub signalr. then, can allow connections client-side browsers through javascript. verify can make connection , communication between server , clients both work great. go through both signalr wiki , sample projects if feel stuck on anything.
then, assign javascript function callable server-side hub. function update knockout view model adding new tasks.
it's straightforward, not have specific solution examples because feel have catching do. luck on assignment!
Comments
Post a Comment