Open window from controller, but with Action redirect

  1. #1

    Open window from controller, but with Action redirect

    Hello,

    I would like to open a window from controller. I did see this example http://mvc.ext.net/#/Window_Basic/Hello_World/
    but, what I'm trying to do is little different.

    Here is my Window code.

     @(X.Window()
            .ID("uploadfilewindow")
            .Title("uploadfilewindow")
            .Width(1000)
            .Height(500)
            .Modal(true)
            .AutoRender(false)
            .Collapsible(false)
            .Maximizable(false)
            .Hidden(true)
            .ContentFromPartial("fileupload")
           
       )
    This window is accessed here in this action.
    public DirectResult uploadfilewindow()
            {
                //var window = X.GetCmp<Window>("uploadfilewindow");
                //window.Show();
                
                X.GetCmp<Window>("uploadfilewindow").Show();
                return this.Direct();
            }

    But however I'm not calling the action directly on button click (not a direct event) The link specified is working for only direct event of button click. I'm calling a ActionResult A() which up on some conditions will redirect it to DirectResult uploadfilewindow(), that initiates the window to open. But it dint work as I thought.

    Heres a fragment of code that shows what I'm trying to do.:

    Public ActionResult A()
    {
    Conditions
    if{
    return ReditrecttoAction("fileuploadwindow");
    }
    else
    {
    return PartialView();
    }
    }
    ThButton click direct event is redirected from this action to above specified(uploadfilewindow) action. Now, the direct action called is A() and action which returns to View is uploadfilewindow(), which doesnt open my pop up window.

    However if I change property hidden = false. I can see the window. Could some one how do I achieve this ?

    EDIT : My window is part of a partial view on parent window.

    Any help is appreciated,

    Thanks,
    Vakshu.
    Last edited by rvisha2; Oct 24, 2013 at 7:13 PM.

Similar Threads

  1. Replies: 0
    Last Post: Oct 24, 2013, 2:53 PM
  2. [CLOSED] [Razor] TreePanel load nodes from controller action
    By boris in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: May 18, 2012, 9:43 AM
  3. Replies: 0
    Last Post: Nov 22, 2011, 6:17 AM
  4. Replies: 3
    Last Post: Mar 23, 2011, 5:38 PM
  5. [CLOSED] How to display Confirm box from Controller Action in MVC
    By webppl in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 09, 2010, 9:31 PM

Tags for this Thread

Posting Permissions