0

Hi everyone I am very new with jquery ui, I am try to create a Dialog when I click a link, but my app open a white page.

this is my link

 <%: Html.ActionLink("Select Image", "SelectImage", "VacationPackage", null, new { @class = "newWindows" })%>

in the same view I have this

<script language="javascript" type="text/javascript">
    $(function () {
        $("#newWindows").dialog();
    });
</script>

my problem is I don't know how create my view I put this ...

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Administration.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    SelectImage
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>SelectImage</h2>

<% Html.RenderPartial("ListImage"); %> 

</asp:Content>

Buy don't open the ListImage.. only a white page.

What is the problem??? I am trying many examples but i obtain the same result. any idea???

thanks.

1 Answer 1

1

Puh ;) many mistakes.

  • your dialog should be a div container.
  • your link should fire the $("#<DIV_CONTAINER_ID").dialog();

Something like this...

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

    <div id="dialog">Hello, iam a Dialog!</div>
    <a id="dialogOpener">Open Dialog</a>
Sign up to request clarification or add additional context in comments.

1 Comment

thanks dknaack, but I have the same problem with the change, I don't know what is wrong. I think I show the view in a wrong place. I have a view, it is a form and there I have link to call the dialog. In the same view I have the javascript and the div to open de dialog. The link call to method SelectImage this open to partiaView like this return View("_SelectImage"); I think this is the problem ... the partialview is empty...and when a click it show me the white page, but i dont know how activate my dialog..if I call $(function (){ $("dialogOpener").click(function (){ $("#dialog").dialog()});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.