Jul 10, 2011, 9:39 PM
[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:
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]