[CLOSED] AutoLoad - passing parameters

  1. #1

    [CLOSED] AutoLoad - passing parameters

    Hi,

    I'm having trouble passing parameters with AutoLoad. In my user control I get the nodeId I'm after through the ViewBag and that works fine. I cannot seem to pass that value onto the page I want to load. The parameter set in the user control page appears to be empty, perhaps passing it to the ascx using the ViewBag is the wrong approach.

    Controller:

    public ActionResult Index(string nodeId)
            {
                var pr = new PartialViewResult();
                pr.SingleControl = true;
    
                pr.ViewBag.NodeId = nodeId;
    
                return pr;
            }
    User Control (Index.ascx):

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script runat="server">
        // Load defaults
        public string nodeId = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            nodeId = ViewBag.NodeId;
        }
    </script>
    
    <ext:Window
        Title='' 
        runat="server" 
        Modal="true" 
        ID="ChartWindow" 
        AutoDataBind="true"
        Width="900"
        Height="670" >
        <AutoLoad Url="/en/Chart/Chart" Mode="IFrame" AutoDataBind="true">
            <Params>
                <ext:Parameter Name="PID" Value="this.nodeId" Mode="Raw" />
            </Params>
        </AutoLoad>
    </ext:Window>
    Chart.aspx - PID has no value

    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            var nodeId = Request.QueryString["PID"];
        }
    </script>
    Thanks for any input.
    Last edited by Daniil; Jul 12, 2011 at 8:36 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Try this
    <ext:Parameter Name="PID" Value="#<%ViewBag.NodeId%>" Mode="Value" AutoDataBind="true" />
  3. #3
    Hi Vladimir,

    I tried that and on my Chart.aspx page the value for Request.QueryString["PID"] is: "#<%ViewBag.NodeId%>"

    Thanks.

    Quote Originally Posted by Vladimir View Post
    Hi,

    Try this
    <ext:Parameter Name="PID" Value="#<%ViewBag.NodeId%>" Mode="Value" AutoDataBind="true" />
  4. #4
    I mistyped
    Value="<%# ViewBag.NodeId %>"
  5. #5
    Perfect - thanks!

    Quote Originally Posted by Vladimir View Post
    I mistyped
    Value="<%# ViewBag.NodeId %>"

Similar Threads

  1. [CLOSED] passing parameters into tabs with autoloads
    By jeremyl in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 30, 2010, 10:32 AM
  2. [CLOSED] [1.0] Panel AutoLoad Parameters Bug
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 08, 2010, 9:59 AM
  3. [CLOSED] Parameters with Autoload iFrame
    By Adrian in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Aug 03, 2009, 4:51 PM
  4. Tab AutoLoad Parameters - help!?!?
    By Tbaseflug in forum 1.x Help
    Replies: 2
    Last Post: May 15, 2009, 12:33 PM
  5. Passing parameters with HttpProxy / Store
    By Washburn in forum 1.x Help
    Replies: 1
    Last Post: Jan 12, 2009, 6:18 AM

Tags for this Thread

Posting Permissions