[CLOSED] How to load a page inside a panel using code behind and javascript function?

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] How to load a page inside a panel using code behind and javascript function?

    Hi,

    Cuould you please give me an example about how to load a page inside a panel using code behind and javascript function?

    Thanks,

  2. #2

    RE: [CLOSED] How to load a page inside a panel using code behind and javascript function?

  3. #3

    RE: [CLOSED] How to load a page inside a panel using code behind and javascript function?

    Hi,

    I used the following code to load a page by code behind and it worked fine, but I got an error when I try to the same in a Javascript function.

    I am attaching a screen with the error.

    
    
    
    <script runat="server">
    
    
    
    // This code works fine
    
    protected void Page_Load(object sender, EventArgs e)
    
    
    {
    
    
    if (!X.IsAjaxRequest)
    
    
    {
    
    
    PanelContent.AutoLoad.Url = this.ResolveUrl(@"~\ManagePortal.aspx");
    
    
    PanelContent.AutoLoad.Mode = LoadMode.IFrame;
    
    
    PanelContent.AutoLoad.NoCache = true;
    
    
    PanelContent.LoadContent(); 
    
    
    }
    
    
    }
    
    
    
    
    
    </script>
    
    
    
    
    
    
    // I got the error here
    
    <script type="text/javascript">
    
    
    var loadPage = function()
    
    
    {
    
    
    PanelContent.AutoLoad.Url = 'ManagePortal.aspx';
    
    
    PanelContent.AutoLoad.Mode = LoadMode.IFrame;
    
    
    PanelContent.AutoLoad.NoCache = true;
    
    
    PanelContent.LoadContent(); 
    
    
    }
    
    
    </script>
  4. #4

    RE: [CLOSED] How to load a page inside a panel using code behind and javascript function?

    I used the following code to load a page by code behind and it worked fine, but I got an error when I try to the same in a Javascript function.
    Please see http://forums.ext.net/showthread.php?postid=28083.aspx


    Geoffrey McGill
    Founder
  5. #5

    RE: [CLOSED] How to load a page inside a panel using code behind and javascript function?

    Hi,

    The problem that I have it is that I am using relative path and it seems that the page it is not founded.

    Is it the following code right to load the page from the current directory in Javascript or do I have to do something else?

    <script type="text/javascript">
        var loadPage = function()
        {
            PanelContent.load('~/ManagePortal.aspx');
        }
    </script>
  6. #6

    RE: [CLOSED] How to load a page inside a panel using code behind and javascript function?

    The Tilde (~) is only used server-side by the asp.net framework to resolve urls to the "Application Root". On the client, you'll have to use an "Absolute Path", or "Relative Path" to the file.

    If you remove the "~", does the page load?


    Geoffrey McGill
    Founder
  7. #7

    RE: [CLOSED] How to load a page inside a panel using code behind and javascript function?

    Not it does not load even if a remove "~"
  8. #8

    RE: [CLOSED] How to load a page inside a panel using code behind and javascript function?

    flormariafr (2/24/2010)Not it does not load even if a remove "~"
    It is not loading because you do not have the correct path to the file. If removing the '~' did not solve the problem, then you'll have to revise to the correct path.


    Geoffrey McGill
    Founder
  9. #9

    RE: [CLOSED] How to load a page inside a panel using code behind and javascript function?

    If I use the following code when the page is loaded it works fine:

    
    
    
    <script runat="server">
    
    
    protected void Page_Load(object sender, EventArgs e)
    
    
    {
    
    
    if (!X.IsAjaxRequest)
    
    
    {
    
    
    
     
    
    
    PanelContent.AutoLoad.Url = this.ResolveUrl(@"~\ManagePortal.aspx");
    
    
    PanelContent.AutoLoad.Mode = Ext.Net.LoadMode.IFrame;
    
    
    PanelContent.AutoLoad.NoCache = true;
    
    
    PanelContent.LoadContent();
    
    
    }
    
    
    }
    
    
    
    
    
    </script>
  10. #10

    RE: [CLOSED] How to load a page inside a panel using code behind and javascript function?

    flormariafr (2/24/2010)If I use the following code when the page is loaded it works fine:
    Thanks for the update. I'm happy to hear your sample is now working.


    Geoffrey McGill
    Founder
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 5
    Last Post: Oct 23, 2012, 2:19 PM
  2. [CLOSED] Calling a code-behind function from my aspx page
    By Bert76 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 08, 2011, 3:53 PM
  3. [CLOSED] Calling a Javascript function of Child page from Popup (inside Frame)
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 27, 2011, 6:00 AM
  4. How to call the javascript function form code behind
    By harshad.jadhav in forum 1.x Help
    Replies: 3
    Last Post: Mar 29, 2011, 3:00 PM
  5. [CLOSED] How to call a javascript function from a child page?
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 25, 2010, 5:40 PM

Posting Permissions