0

I have a MVC, ASP.Net application and I want to create a dialog form.I created a view(*.ascx).I am openning this from controller with return View("Questionnaire", list);

The code for my control is this :

   <%@ Control Language="C#"  Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<Questionnaire>>" %>

 <div id="dialog">

 <table>
  <tr><td >Question</td><td colspan="2">Yes/No</td></tr>
    <%  foreach (Questionnaire s in Model)
        {
     %>
      <tr>
 <td><%=s.Question%></td>
 <td><input name="Input<%=s.Id %>"  style="text-align:center;" type="radio" /></td>
 <td><input name="Input<%=s.Id %>"  style="text-align:center;" type="radio" /></td>
 </tr>
  <%
    }
  %>  
 </table>

  </div>

   <script type="text/javascript">

     $(document).ready(function () {
     }); 

     $(function () {
      $("#dialog").dialog();
      });
    </script>

But my view doesn't look like a dialog box .Can somebody tell me what's wrong?

Cr123
  • 93
  • 1
  • 2
  • 7
  • 1
    You have ` – gdoron Feb 21 '12 at 08:58
  • I moved script outside of div.I am new to Javascript/ Ajax and i don't know exactly how to put . – Cr123 Feb 21 '12 at 09:05
  • there is a example here: http://stackoverflow.com/questions/8541821/how-to-simplify-my-statefull-interlaced-modal-dialogs-in-asp-net-mvc –  Sep 10 '12 at 18:39

1 Answers1

3

http://jqueryui.com/demos/dialog/#modal

Arbejdsglæde
  • 13,670
  • 26
  • 78
  • 144
  • I copy on my page:

    Adding the modal overlay screen makes the dialog look more prominent because it dims out the page content.

    and i copy also section script : but nothing happen .It doesn't look like a modal dialog
    – Cr123 Feb 21 '12 at 13:31
  • if my link with examples is ok for you, please check you CSS files. – Arbejdsglæde Feb 21 '12 at 14:39