Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible to translate this into javascript
Message
General information
Forum:
ASP.NET
Category:
MVC
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01561782
Message ID:
01562362
Views:
69
This message has been marked as a message which has helped to the initial question of the thread.
Likes (1)
for one thing you'd want:

$("#editor") not $("editor") which makes the whole thing fall down.

+++ Rick ---

>Hi everybody,
>
>I found a good link showing how to use modal dialogs in ASP.NET MVC application
>
>http://www.matthidinger.com/archive/2011/02/22/Progressive-enhancement-tutorial-with-ASP-NET-MVC-3-and-jQuery.aspx
>
>For my purpose I am using buttons and I need to associate action with buttons in run-time using JavaScript.
>
>In his code he is using the following:
>
>
>@Html.ActionLink("Contact Us", "ContactUs", "Home", null, new{ @class = "openDialog", data_dialog_id = "emailDialog", data_dialog_title = "Contact Us"})
>
>
>I am wondering if there is a way to somehow do the same but using JavaScript?
>
>This is what I have right now but this is not working and not even opening a dialog:
>
>
>var $dlg = $("editor").dialog({
>    autoOpen: false,
>    show: "blind",
>    closeOnEscape: true,
>    resizable: true,
>    width: 1200,
>    height: 750,
>    minHeight: 600,
>    minWidth: 950
>});
>
>function RunModalDialog(title, url)
>{    
>    if (title)
>        $dlg.dialog("option", {"title": title });
>
>    if (url)
>    {        
>        $dlg.load(url).dialog("option", { "title": title }).dialog("open");
>    }
>        //$dlg.load(url, function () {
>        //    var validator = $("#sform").validate();
>        //    if (validator)
>        //         validator.resetForm();
>        //    $dlg.dialog("option", { "title": title }).dialog("open");
>        //});
>    else {
>        var validator = $("#sform").validate();
>        if (validator)
>            validator.resetForm();
>        $dlg.dialog("open");
>    }
>}
>
>and in the main page I have right now
>
>
><div id="editor" style ="visibility :hidden ">
>    
></div>
>
>
>Do you see how can I translate the ActionLink into JavaScript?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform