0

net MVC usig knockout js to bind data. But I am stuck on this below problem. I am display message if ajax result return true but it does not work Here below is the code. Please help me

 self.Message = ko.observable(false);      

          $.ajax({
                url: '@Url.Action("SaveAccount", "Accounts")',
                cache: false,
                type: 'POST',
                contentType: 'application/json',
                data: jsonData,
                success: function (result) {
                    //ShowToastMessage("This is message", "This is title");
                    self.DealerID(result.DealerId);
                    self.Message = ko.observable(result.Message); //result.Message = true   
                    //self.Message(result.Message);
                    //window.location.href = result.url;
                },
                error: function (errorThrown) {
                }
            });
<div class="alert alert-success alert-dismissable" id="Success-alert" data-bind="visible: Message">
   <label>Success! Account has been saved successfully</label>
</div>
Parth Savadiya
  • 1,203
  • 3
  • 18
  • 40

0 Answers0