5 Nov 2004 01:17
Question about redirects and params
Don Ness <don.ness <at> tamu.edu>
2004-11-05 00:17:41 GMT
2004-11-05 00:17:41 GMT
I have a controller (using ThrowawayForm) where I'm specifying params in the Maverick.config. It looks like this: <command name="update"> <controller class="VirtualBookworm.Royalties.Ctl.Authors.UpdateForm, VirtualBookworm.Royalties"> <param name="roles" value="Author"/> </controller> <view name="unauthorized" ref="login"/> <view name="success" type="redirect" path="update.m?dispatch=view"/> <view name="update"> <transform path="web/authors/update.xsl"/> <transform path="web/main.xsl"/> </view> </command> I have created a base class called DispatchForm that calls a method based on the value of the request variable "dispatch". So update.m?dispatch=view calls UpdateForm.View(), and update.m?dispatch=update calls UpdateForm.Update(). After I perform an update, I redirect back to my controller to call UpdateForm.View() again. When I redirect, it redirects to update.m?dispatch=view?roles=Author. It seems to be tacking on the controller params during a redirect, and it's not using an ampersand either. I looked at Maverick's RedirectView object, and I see that it only adds params for the view. Does the view context also contain the parameters for the controller context? I can't seem to find where it's adding those parameters. If that is indeed what is happening, is that the intended function and can anyone suggest a work around?(Continue reading)
Here is the code in case
anyone is interested.
-----
using System;
using System.Xml.Serialization;
using Maverick;
using Maverick.Ctl;
using Maverick.Flow;
using Maverick.Util;
using NPlot;
namespace DiabetesTracker.Ctl.Charts
{
/// <summary>
/// Summary description for ChartController.
/// </summary>
public class ChartController : Throwaway
{
[NonSerialized]
protected NPlot.Bitmap.PlotSurface2D plotSurface = null;
public ChartController()
{
}
RSS Feed