Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# andrew_g 12/16/2007 10:05 AM
Hi,

I need to do something that seems simple but I don't understand how to do it within Cuyahoga.

I have 3 placeholders in a template.

In 1 place holder, I developed a simple module that a user will complete and submit (UserForm.ascx).


a) How can I submit this page and show another confirmation control in that same placeholder? (Confirmation.ascx)

b) Secondly, Can I do this without reloading the entire page?

Your advice will help me greatly.

Thanks.
# martijnb 12/16/2007 9:59 PM (edited 12/16/2007 10:01 PM)
The easiest way to accomplish this is to redirect after submitting the form and add a /confirmation parameter to the url.

From the module controller:
if (success)
{
    HttpContext.Current.Response.Redirect(UrlHelper.GetUrlFromSection(this.Section) + "/confirmation");
}

Then, based on the /confirmation parameter, you can set the CurrentViewControlPath:
public override string CurrentViewControlPath
{
    get
    {
        string basePath = "Modules/MyModule/";
        if (this.ModulePathInfo.StartsWith("/confirmation")
        {
             return basePath + "Confirmation.ascx";
        }
        else
        {
             return basePath + "MyForm.ascx";
        }
    }
}

Hope this helps.

This can't be done without reloading the entire page. For that, you'll need some Ajax stuff.
# andrew_g 12/17/2007 9:39 AM
Great thanks!


Is there any API documentation for Cuyahoga? Where can I find out about the ModuleBase, UrlHelper, etc?


Thanks,
Andrew
# martijnb 12/17/2007 10:00 AM
Uhm well, we used to have an ndoc-generated API doc but since .NET 2.0 this doesn't work anymore.
So the best documentation now at this moment is the source of other modules like the Articles or Downloads module.