Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to return different view from different method in controller in MVC
    primarykey
    data
    text
    <p>can anyone help me? senario is.. I have UserController(UC) and Browse View in MVC, In browse page I have three buttons and thats why i have written javascript to call perticular method in UC, now within UC I am sending data to Model (which is comming from View) and I am able to search from model also. ok..then after searched data is coming from model I am sending that data to view following code.</p> <p>objUser = user.Search(1, "Ramesh", "", "", "", "", FMEnums.UserStatus.InActive);</p> <pre><code> if (objUser.Count &lt;= 0) { ViewData["Message"] = "Unauthorised"; return View("Browse", objUser); } else { return View("Browse", objUser); } and in View( that is Browse.aspx) by giving </code></pre> <p>( &lt;%@ Page Title="Max 2.0" Language="C#" MasterPageFile="~/Views/Shared/Master.Master" Inherits="System.Web.Mvc.ViewPage>"%> ) </p> <p>at the start of my Browse page I am accepting that data. ok...</p> <pre><code> and rendering that incoming data by following code.. &lt;%if(Model != null){ %&gt; &lt;tr&gt; &lt;td class="td_bgcolor"&gt; User Name &lt;/td&gt; &lt;td class="td_bgcolor"&gt; First Name &lt;/td&gt; &lt;td class="td_bgcolor"&gt; Last Name &lt;/td&gt; &lt;td class="td_bgcolor"&gt; e-mail &lt;/td&gt; &lt;td class="td_bgcolor"&gt; Role &lt;/td&gt; &lt;td class="td_bgcolor"&gt; Staus &lt;/td&gt; &lt;td class="td_bgcolor"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;% foreach( var user in Model)%&gt; &lt;%{ %&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="#"&gt;&lt;%=user.UserName %&gt;&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;%=user.FirstName %&gt;&lt;/td&gt; &lt;td&gt;&lt;%=user.LastName %&gt;&lt;/td&gt; &lt;td&gt;&lt;%=user.Email %&gt;&lt;/td&gt; &lt;td&gt;&lt;%=user.Status %&gt;&lt;/td&gt; &lt;td&gt;&lt;%=user.Roles %&gt;&lt;/td&gt; &lt;td&gt; &lt;a href="#"&gt;Delete&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;%} %&gt; &lt;%} %&gt; </code></pre> <p>Butt..</p> <p>now the problem is...it is successfully debugging but my Browse page is not comming with data instead browser is rendering "User/Search" page which is not even in the project.</p> <p>plzzzzzzz can any one have solution?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload