2
Reply

How to redirect to another view

prabhu p

prabhu p

Jan 22 2018 2:41 AM
158
In MVC5, I have one question,
 
Iam calling one Action Method(second page) from jquery from First page button click
Everything working fine but atlast i need second action metod view want to load.
could any one help on this.
  1. $('#report').click(function () {  
  2. debugger  
  3. $.ajax({  
  4. url: '@Url.Action("loadreport", "Report")',  
  5. type: 'GET',  
  6. data: { Mid: $(Txt_Monitor).val() },  
  7. cache: false,  
  8. success: function (data) {  
  9. $("#contact").html(data);  
  10. $header = $('.header');  
  11. $("#div1").show();  
  12. $header1 = $('.header tr td');  
  13. var x = $header.find('td');  
  14. var k = $header1.find('div');  
  15. $('.panel-body').on('scroll'function () { $header.css('top', $(this).scrollTop()); });  
  16. //var wi = new Array();  
  17. //$('.dt tr').eq(0).find('td').each(function (e) {  
  18. // k.eq(e).width($(this).width() );  
  19. // wi.push(k.eq(e).width());  
  20. //});  
  21. $('.dt thead tr td div').each(function (e) {  
  22. k.eq(e).width($(this).width());  
  23. });  
  24. $("#spinner").hide();  
  25. },  
  26. error: function () {  
  27. // handle ajax error  
  28. $("#spinner").hide();  
  29. }  
  30. });  
  31. });  
  32. });  
Second action method
  1. public ActionResult loadreport(string Mid)  
  2. {  
  3. int TV = RTS.LoadTV(Mid);  
  4. ViewBag.loadreport = RTS.Loadreport(Mid, TV);  
  5. //ViewData["loadrep"] = new SelectList(loadreport, "Rel_Type", "Rel_Type");  
  6. return View();  
  7. }  
please help on this

Answers (2)