Real time delete functionality ASP NET MVC made with PUSHERPusher - Ping pong functionalityWhat is the claims in ASP .NET IdentityReal time chart using pusher and canvas jsAndroid Google Map + Pusher (real time) ListenerReal Time Fetching data with laravel5.2 , vue.js and pusherHow can I call controller post action from jquery (in custom view page) in mvc .net web apphow to display images pusher real time chatWhy solutions like pusher claim to be “Real time”?Real-time listener doesn't work in PWA with PusherReal time react web app with pusher and laravel

How to cope with regret and shame about not fully utilizing opportunities during PhD?

Will the volt, ampere, ohm or other electrical units change on May 20th, 2019?

Is it safe to use two single-pole breakers for a 240v circuit?

Why was my Canon Speedlite 600EX triggering other flashes?

A case where Bishop for knight isn't a good trade

Re-testing of regression test bug fixes or re-run regression tests?

Why doesn't Iron Man's action affect this person in Endgame?

Why weren't the bells paid heed to in S8E5?

Would life always name the light from their sun "white"

Acronyms in HDD specification

AMPScript Lookup From Child Business Unit

The meaning of the Middle English word “king”

What is this old US Air Force plane?

Substring join or additional table, which is faster?

How to describe a building set which is like LEGO without using the "LEGO" word?

Unexpected Netflix account registered to my Gmail address - any way it could be a hack attempt?

Single word that parallels "Recent" when discussing the near future

is it correct to say "When it started to rain, I was in the open air."

Where to find every-day healthy food near Heathrow Airport?

White foam around tubeless tires

Uh oh, the propeller fell off

Is it wrong to omit object pronouns in these sentences?

Why did the soldiers of the North disobey Jon?

Find the unknown area, x



Real time delete functionality ASP NET MVC made with PUSHER


Pusher - Ping pong functionalityWhat is the claims in ASP .NET IdentityReal time chart using pusher and canvas jsAndroid Google Map + Pusher (real time) ListenerReal Time Fetching data with laravel5.2 , vue.js and pusherHow can I call controller post action from jquery (in custom view page) in mvc .net web apphow to display images pusher real time chatWhy solutions like pusher claim to be “Real time”?Real-time listener doesn't work in PWA with PusherReal time react web app with pusher and laravel






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am trying to implement a real time comment system in ASP.NET MVC 5 made via PUSHER web socket. I want to post and delete a comment in this system.



The submit function works perfect, I followed the steps in this tutorial and everything worked fine.
(https://pusher.com/tutorials/realtime-comments-aspnet/)



The problem I have is at the delete function. First, I need to delete the comment from database(I need the commentID) and after that I need to make async to delete the comment from my webpage list(I need the index for that comment).
If i use this.splice(index,1), the function deletes the item but when I refresh the page it reapers because I cannot reach the controller function.



I know that SignalR would work great here but I want to make it with a websocket.



Can you give me some advices on how I can implement this functionality? I am trying for more than 4 days and I can't find the resolvation.



Thanks.



 public async Task<ActionResult> Delete_comment(Comment data)

Comment com1 = db.Comments.Find(data.CommentID);
db.Comments.Remove(com1);
db.SaveChanges();
var options = new PusherOptions();
options.Cluster = "eu";
var pusher = new Pusher("724721", "a3d740957cfa714c5b6e", "3e1e7ad2abc0c6ccf18f", options);
ITriggerResult result = await pusher.TriggerAsync("asp_channel", "asp_delete_event", com1);
return Content("ok");



FORM



 <form onsubmit="return false;">
<input type="hidden" id="CommentID" v-model="comment.CommentID" class="form-control" />
@Html.HttpMethodOverride(HttpVerbs.Delete)
<button class="btn" v-on:click="delete_comment()">remove </button>
</form>


DELETE SCRIPT



 listen2: function () 
my_channel.bind("asp_delete_event", (data) =>
this.comments.splice(data.index, 1);
alert("Comment Deleted2313");
)
,


delete_comment: function ()
axios.delete('@Url.Action("Delete_comment", "Comments", new , protocol: Request.Url.Scheme)', this.comment)
.then((response) =>
alert("Comment Deleted");
);
,









share|improve this question




























    0















    I am trying to implement a real time comment system in ASP.NET MVC 5 made via PUSHER web socket. I want to post and delete a comment in this system.



    The submit function works perfect, I followed the steps in this tutorial and everything worked fine.
    (https://pusher.com/tutorials/realtime-comments-aspnet/)



    The problem I have is at the delete function. First, I need to delete the comment from database(I need the commentID) and after that I need to make async to delete the comment from my webpage list(I need the index for that comment).
    If i use this.splice(index,1), the function deletes the item but when I refresh the page it reapers because I cannot reach the controller function.



    I know that SignalR would work great here but I want to make it with a websocket.



    Can you give me some advices on how I can implement this functionality? I am trying for more than 4 days and I can't find the resolvation.



    Thanks.



     public async Task<ActionResult> Delete_comment(Comment data)

    Comment com1 = db.Comments.Find(data.CommentID);
    db.Comments.Remove(com1);
    db.SaveChanges();
    var options = new PusherOptions();
    options.Cluster = "eu";
    var pusher = new Pusher("724721", "a3d740957cfa714c5b6e", "3e1e7ad2abc0c6ccf18f", options);
    ITriggerResult result = await pusher.TriggerAsync("asp_channel", "asp_delete_event", com1);
    return Content("ok");



    FORM



     <form onsubmit="return false;">
    <input type="hidden" id="CommentID" v-model="comment.CommentID" class="form-control" />
    @Html.HttpMethodOverride(HttpVerbs.Delete)
    <button class="btn" v-on:click="delete_comment()">remove </button>
    </form>


    DELETE SCRIPT



     listen2: function () 
    my_channel.bind("asp_delete_event", (data) =>
    this.comments.splice(data.index, 1);
    alert("Comment Deleted2313");
    )
    ,


    delete_comment: function ()
    axios.delete('@Url.Action("Delete_comment", "Comments", new , protocol: Request.Url.Scheme)', this.comment)
    .then((response) =>
    alert("Comment Deleted");
    );
    ,









    share|improve this question
























      0












      0








      0








      I am trying to implement a real time comment system in ASP.NET MVC 5 made via PUSHER web socket. I want to post and delete a comment in this system.



      The submit function works perfect, I followed the steps in this tutorial and everything worked fine.
      (https://pusher.com/tutorials/realtime-comments-aspnet/)



      The problem I have is at the delete function. First, I need to delete the comment from database(I need the commentID) and after that I need to make async to delete the comment from my webpage list(I need the index for that comment).
      If i use this.splice(index,1), the function deletes the item but when I refresh the page it reapers because I cannot reach the controller function.



      I know that SignalR would work great here but I want to make it with a websocket.



      Can you give me some advices on how I can implement this functionality? I am trying for more than 4 days and I can't find the resolvation.



      Thanks.



       public async Task<ActionResult> Delete_comment(Comment data)

      Comment com1 = db.Comments.Find(data.CommentID);
      db.Comments.Remove(com1);
      db.SaveChanges();
      var options = new PusherOptions();
      options.Cluster = "eu";
      var pusher = new Pusher("724721", "a3d740957cfa714c5b6e", "3e1e7ad2abc0c6ccf18f", options);
      ITriggerResult result = await pusher.TriggerAsync("asp_channel", "asp_delete_event", com1);
      return Content("ok");



      FORM



       <form onsubmit="return false;">
      <input type="hidden" id="CommentID" v-model="comment.CommentID" class="form-control" />
      @Html.HttpMethodOverride(HttpVerbs.Delete)
      <button class="btn" v-on:click="delete_comment()">remove </button>
      </form>


      DELETE SCRIPT



       listen2: function () 
      my_channel.bind("asp_delete_event", (data) =>
      this.comments.splice(data.index, 1);
      alert("Comment Deleted2313");
      )
      ,


      delete_comment: function ()
      axios.delete('@Url.Action("Delete_comment", "Comments", new , protocol: Request.Url.Scheme)', this.comment)
      .then((response) =>
      alert("Comment Deleted");
      );
      ,









      share|improve this question














      I am trying to implement a real time comment system in ASP.NET MVC 5 made via PUSHER web socket. I want to post and delete a comment in this system.



      The submit function works perfect, I followed the steps in this tutorial and everything worked fine.
      (https://pusher.com/tutorials/realtime-comments-aspnet/)



      The problem I have is at the delete function. First, I need to delete the comment from database(I need the commentID) and after that I need to make async to delete the comment from my webpage list(I need the index for that comment).
      If i use this.splice(index,1), the function deletes the item but when I refresh the page it reapers because I cannot reach the controller function.



      I know that SignalR would work great here but I want to make it with a websocket.



      Can you give me some advices on how I can implement this functionality? I am trying for more than 4 days and I can't find the resolvation.



      Thanks.



       public async Task<ActionResult> Delete_comment(Comment data)

      Comment com1 = db.Comments.Find(data.CommentID);
      db.Comments.Remove(com1);
      db.SaveChanges();
      var options = new PusherOptions();
      options.Cluster = "eu";
      var pusher = new Pusher("724721", "a3d740957cfa714c5b6e", "3e1e7ad2abc0c6ccf18f", options);
      ITriggerResult result = await pusher.TriggerAsync("asp_channel", "asp_delete_event", com1);
      return Content("ok");



      FORM



       <form onsubmit="return false;">
      <input type="hidden" id="CommentID" v-model="comment.CommentID" class="form-control" />
      @Html.HttpMethodOverride(HttpVerbs.Delete)
      <button class="btn" v-on:click="delete_comment()">remove </button>
      </form>


      DELETE SCRIPT



       listen2: function () 
      my_channel.bind("asp_delete_event", (data) =>
      this.comments.splice(data.index, 1);
      alert("Comment Deleted2313");
      )
      ,


      delete_comment: function ()
      axios.delete('@Url.Action("Delete_comment", "Comments", new , protocol: Request.Url.Scheme)', this.comment)
      .then((response) =>
      alert("Comment Deleted");
      );
      ,






      asp.net model-view-controller delete-row pusher






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 23 at 14:19









      Andrei TeodorescuAndrei Teodorescu

      11




      11






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314652%2freal-time-delete-functionality-asp-net-mvc-made-with-pusher%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314652%2freal-time-delete-functionality-asp-net-mvc-made-with-pusher%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript