SHARE
TWEET

Untitled

a guest Mar 20th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. @{
  3.     ViewBag.Title = "Create";
  4. }
  5.  
  6.  
  7. <h2>Create</h2>
  8. @using (Ajax.BeginForm("CreateObject", new AjaxOptions { OnSuccess = "Create" }))
  9. {
  10.     <input type="text" name="name" />
  11.     <input type="text" name="age" />
  12.     <input type="submit" value="create" />
  13. }
  14.  
  15. <div id="object"></div>
  16. <br />
  17. <textarea id="text"></textarea>
  18.  
  19. <br />
  20. @using (Ajax.BeginForm("RegressionTest", new AjaxOptions { OnSuccess = "Regression" }))
  21. {
  22.     <input type="text" name="xValue" />
  23.     <input type="text" name="yValue" />
  24.     <input type="submit" value="create" />
  25. }
  26. <div id="reg"></div>
  27.  
  28. @Scripts.Render("~/Scripts/jquery-3.3.1.min.js")
  29. @Scripts.Render("~/Scripts/jquery.unobtrusive-ajax.min.js")
  30.  
  31. <script type="text/javascript">
  32.     function Create(data) {
  33.         var results = $('#object');
  34.         results.empty();
  35.         results.append('<li>' + data.Name + '<li>' + data.Age);
  36.         var text = $('#text');
  37.         text.append(data.Name + '   ' + data.Age)
  38.     }
  39.  
  40.     function Regression(data) {
  41.         var results = $('#reg');
  42.         results.empty();
  43.         results.append('<li>' + data.RegString + '<li>' + data.korrelation );
  44.     }
  45.  
  46. </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top