MVC C# modal popup

Viewed 70520

ok so i'm trying to figure out how to properly call a modal popup for my page using Controllers as per this post's suggestion

ASP.NET MVC modal dialog/popup best practice

and kinda used this:

http://microsoftmentalist.com/2011/09/14/asp-net-mvc-13-open-window-or-modal-pop-up-and-fill-the-contents-of-it-from-the-controller-method/

I have a view that has a dropdownlist, if the user can't find the item / value that he/she is looking for he can suggest a value (suggest new value link) which is supposed to call the controller and return a popup page with a couple of fields in it.

Here're the objects on the view:

<script type="text/javascript">

        loadpopup = function () 
        {  
window.showModalDialog(‘/NewValue/New′ , "loadPopUp", ‘width=100,height=100′); 
        } 

    </script> 


<%: Html.DropDownList(model => model.ValueId, new selectlist........... %>
<%: Html.ActionLink("Suggest Value", "New", "NewValue", null, new { onclick = 'loadpopup()') %>

The controller that I'm planning to use to return the page:

public class NewValueController : Controller{
   public Actionresult New(){
      return View();
   }
}

Now I'm stuck. I wanted to return a page where I can format it, do i have to return a string ? can't i return an aspx (engin i use) instead, since formatting that would be easier?

Any advice as to which direction i should go is very much appreciated.

Thanks!

2 Answers
Related