[CLOSED] Redirect to other url in Window

  1. #1

    [CLOSED] Redirect to other url in Window

    Probably simple, but I can't figure it out.

    I'm calling a DirectMethod from javascript Like this:

    function changePage(jaar, kwartaal) {
                Ext.net.DirectMethods.refreshWindow(jaar, kwartaal);
            }
    Code Behind:

      [DirectMethod]
        public void refreshWindow(Int32 Jaar, Int32 Kwartaal)
        {
            Session["Jaar"]        = Jaar;
            Session["Kwartaal"] = Kwartaal;
            //Open other url in THIS current window (iframe)
            X.Redirect("http://www.google.nl");
        }
    The sessions are set, but the redirect (url change of the current window) fails ?

    What am I doing wrong here ?

    Martin
    Last edited by Daniil; Nov 04, 2010 at 4:14 PM. Reason: [CLOSED]
  2. #2
    Hi,

    What is mean fails? Do you have any errors?
    Do you want to reload iframe inside window? Which DirectMethod do you call: iframe direct method or base page direct window?
  3. #3
    Quote Originally Posted by Vladimir View Post
    Hi,

    What is mean fails? Do you have any errors?
    Do you want to reload iframe inside window? Which DirectMethod do you call: iframe direct method or base page direct window?
    Simplified the code of redirect.aspx:

    <%@ Page Language="C#" %>
    <%@ register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
        [DirectMethod]
        public void refreshWindow(Int32 Jaar, Int32 Kwartaal)
        {
            Session["Jaar"] = Jaar;
            Session["Kwartaal"] = Kwartaal;
            X.Redirect("http://www.google.nl");
        }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
            <script type="text/javascript">
            function changeGrid(jaar, kwartaal) {
                Ext.net.DirectMethods.refreshWindow(jaar, kwartaal);
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
         <a href="javacript:void(0)" onclick="changeGrid(2010,2)" style="font-weight:bold;">2010 kwartaal 2</a>
        </div>
        </form>
    </body>
    </html>
    This page is opened from another window like this:

    function createDetailWindow(debiteurId, bestuurderId) {
        if (top.winBekeuringenGrid) {
            top.winBekeuringenGrid.destroy();
        }
        alert(debiteurId);
        alert(bestuurderId);
        var win = new top.window.Ext.Window({
        id: 'winBekeuringenGrid',
            title: "Bekeuringen",
            width: top.document.documentElement.clientWidth - 50,
            height: top.document.documentElement.clientHeight - 80,
            maximizable: true,
            minimizable: true,
            Icon: "MagnifierZoomIn",
            toFront: true,
            constrainHeader: true,
            autoLoad: {
                showMask: true,
                mode: "iframe",
                url: "redirect.aspx"
            }
        });
        win.show();
    }
    Hope you understand what I achieve. The only restriction i have is the <a href> (which is created by an external dll)

    Martin
  4. #4
    Hi,

    I guess that you have to return false from onclick
    onclick="changeGrid(2010,2); return false;"
  5. #5
    Quote Originally Posted by Vladimir View Post
    Hi,

    I guess that you have to return false from onclick
    onclick="changeGrid(2010,2); return false;"

    Aaaaargh... stupid me :(

    Thanks Vlad..totally overlooked that

    Martin
  6. #6

    Abrir nuevo tab

    X.ResourceManager.RegisterClientScriptBlock("After ",
    @"closeTab('MENU_39_DERECHA');
    closeTab('MENU_40_DERECHA');
    closeTab('MENU_41_DERECHA');
    closeTab('MENU_43_DERECHA');
    closeTab('MENU_44_DERECHA');
    closeTab('MENU_45_DERECHA');
    closeTab('MENU_49_DERECHA');
    closeTab('MENU_61_DERECHA');
    parent.addTab(parent.PanelCentral,'MENU_41','Conta bilidad5.aspx' , 'Diario',true);");

Similar Threads

  1. [CLOSED] about:After login Redirect?
    By wkcode in forum 1.x Help
    Replies: 6
    Last Post: Jan 15, 2013, 5:12 AM
  2. [CLOSED] Differences between X.Redirect and Response.Redirect
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 10, 2012, 4:29 PM
  3. Replies: 6
    Last Post: Feb 03, 2010, 3:31 PM
  4. [CLOSED] redirect in ajaxevent
    By alexp in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 20, 2009, 12:29 PM
  5. [CLOSED] Redirect in ajaxevent
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Nov 18, 2008, 7:30 PM

Posting Permissions