Returning Data From An Edit Page

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/12/2012 3:51:11 PM
Gravatar
Total Posts 148

Returning Data From An Edit Page

Hi:

I have created a control that uses mojoPortal to adjust parameters through the Features Page. I added a simple Edit Page to my control so users can type in paragraphs of text instead of just using a Text Box. The two links, "Settings" and "Edit" appear next to my control.  

I can go to the edit page through the "Edit" link but how do I get back?  Also, how do you return any data you added to the Edit Page?

 

 

1/13/2012 7:48:48 AM
Gravatar
Total Posts 18439

Re: Returning Data From An Edit Page

Hi,

The typical pattern if you have one supporting edit page in addition to the module is to redirect back to the CMS page after updating the data and that would make it reload the data including the new data.

So after you process the button click to save the data you would do something like:

WebUtils.SetupRedirect(this, SiteUtils.GetCurrentPageUrl());

SiteUtils.GetCurrentPageUrl is determining the page from the pageid parameter passed in the url for your supporting page.

It is more complicated if you have more supporting pages, for example in the forums we don't redirect back to the cms page we redirect back to Thread.aspx passing all the needed params after a post is edited.

Hope that helps,

Joe

1/13/2012 12:02:24 PM
Gravatar
Total Posts 148

Re: Returning Data From An Edit Page

Hi:

In my Page_Load function for my Edit page, the value for hdnReturnUrl = null. Because of this I receive an exception during this code:

if ((Request.UrlReferrer != null) && (hdnReturnUrl.Value.Length == 0))  {

                    hdnReturnUrl.Value = Request.UrlReferrer.ToString();

   }

1/13/2012 12:16:20 PM
Gravatar
Total Posts 148

Re: Returning Data From An Edit Page

Also, is a Feature Definition file required for a control with an Edit page?

1/13/2012 12:22:30 PM
Gravatar
Total Posts 2253

Re: Returning Data From An Edit Page

A feature definition file is not required at all.

I don't understand why you are so resistant to creating one. If your feature is going to be installed anywhere besides your development machine, you are going to have to re-enter each one of your settings. The feature definition file prevents you from needing to redo work like this.

Thanks,
Joe D.

1/13/2012 12:45:08 PM
Gravatar
Total Posts 148

Re: Returning Data From An Edit Page

Hi:

The reason I don't want to use a Feature Confg file at this time is because I'm interested in getting the control to work first.  Adding a Feature Config file will add to the complexity of my debugging.

1/13/2012 12:56:14 PM
Gravatar
Total Posts 18439

Re: Returning Data From An Edit Page

in my Page_Load function for my Edit page, the value for hdnReturnUrl = null

thats because you copy/pasted some code without first understanding what it is. In the page where you copied it from there exists an

<asp:HiddenField ID="hdnReturnUrl" runat="server" />

but it doesn't exist in your page so its null.

why not just follow my previous suggestion?

WebUtils.SetupRedirect(this, SiteUtils.GetCurrentPageUrl());

1/15/2012 7:46:28 PM
Gravatar
Total Posts 148

Re: Returning Data From An Edit Page

Hi:

Thanks, the hidden control was throwing me. I didn't try the WebUtils route. Maybe when I get to work tomorrow. Thanks alot for your help. I really love mojoPortal. Have a beer! (I prefer coffee but I don't see a button for it.)

1/17/2012 6:01:25 AM
Gravatar
Total Posts 18439

Re: Returning Data From An Edit Page

Thanks for the beer! If you prefer to buy coffee next time, you can click here, there is also a link on the buy Joe a Beer page that links to Buy Joe a Coffee I appreciate both beer and coffee!

Cheers,

Joe

You must sign in to post in the forums. This thread is closed to new posts.