Cross page posting problem

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.
7/21/2010 4:06:44 AM
Gravatar
Total Posts 34

Cross page posting problem

Hi,

 

I haven't really had the need to do cross site posting before, so I am not sure if this is Mojo plugin specific issue or just i have no idea what I am doing. I am basically making a central page to plug in to Mojo and then post to another page that I have plugged into Mojo.  Posting to the Mojo created aspx file.  The posting works, it's just getting the data I am stuck with.  If it matters, i am using the PostBackUrl on an ImageButton.

I have read the MSDN articles and they all make sense, but still to no avail.  I have tried using the previouspagetype attribute so can get strongly typed properties, but this doesn't work and I'm assuming this is because its a web user control and not a full page.

I have then gone for the Page.Previouspage.Findcontrol() to try and grab a control from the page and it just finds NULL.

I have read loads of articles and scanned the forums and have tried every combination of everything I can think.  Do i resort to passing the variable in the URL or can someone here help me / give me some sample code.

 

Many thanks and good job with the CMS

 

Matt

 

7/21/2010 5:07:16 AM
Gravatar
Total Posts 34

Re: Cross page posting problem

Hi,

 

Just and update of information, the previouspage is NULL and not even set.  The isCrossPagePostBack is false to.

Is this because its using the same master page for all pages with a plugin inside?  If so, how do I access the last pages information?

 

Thanks

7/21/2010 8:33:04 AM
Gravatar
Total Posts 18439

Re: Cross page posting problem

Hi,

Posting to the Mojo created aspx file.

mojoPortal does not create .aspx pages. All the CMS pages, that is the pages in the menu are served by /Default.aspx?pageid=x but with url re-writing you see a friendly url instead.

You cannot use cross page postback from one CMS page to another, that is not going to work very well. If building a custom module you should postback to itself or a physical .aspx page that you create as a supporting page, but even in that case you are not likely to have success getting a reference to the previous page, you would just have to work with the raw posted form variables. Cross page postback is messy business to begin with and I recommend avoid it if at all possible and re-think your implementation.

Hope it helps,

Joe

7/21/2010 10:28:57 AM
Gravatar
Total Posts 34

Re: Cross page posting problem

Hi Joe,

Thanks very much for confirming that, I thought I was going mad at first :-).

I really don't want to use URL's and need to post at least the SQL Id to another page as i don't want the same control processing everything as it all gets too messy with millions of panels etc.  I have just used a Session variable for now, some how it feels like a dirty hack, is there a better way to pass a variable to another page without GET stuff in the url or is this perfectly fine practice?

Thanks

Matt

7/23/2010 8:40:57 AM
Gravatar
Total Posts 18439

Re: Cross page posting problem

Hi Matt,

You can pass query string parameters to the supporting pages of a feature as long as the parameters don't contain data that needs to be secured.

You should not pass parameters to other CMS pages, only to supporting pages of your feature. To learn what I mean about supporting pages you should watch the developer training videos, especially 22, 23, and 24 of the series.

I'm not wild about session variables and don't use them in mojoPortal code but you can use that approach if you want to. It depends on your scaling needs and how much server memory you have available. Session variables use server memory and most budget or shared hosting doesn't provide lots of memory but if you are on a dedicated server with more memory it may be fine for your needs.

Hope that helps,

Joe

7/23/2010 8:53:52 AM
Gravatar
Total Posts 34

Re: Cross page posting problem

Hi Joe,

I really appreciate you taking the time to reply.

Memory is not an issue as this is a full blown server in our data center, so not too worried about that.  The reason I shyed away from Session variables a bit  is because it really has nothing to do with the session and it felt like a hack to get it to work, but am happy if that's a fair way to do it.

The reason i didn't want to use querystrings is purely aesthetic, as i am using GUIDS for the id's and it looks messy ;-)

If I go ahead and use the portal for the project i'm working on I will pester my company to give you a 3 figure donation for your great product and help.

Thanks

Matt

7/23/2010 9:22:16 AM
Gravatar
Total Posts 18439

Re: Cross page posting problem

Hi Matt,

I would not use session variables to avoid ugly query string params myself, though if it does what you need I guess it is ok.

another alternative to consider is using friendly urls. Friendly urls map to real urls with parameters, so for example in the WebStore feature we are really using product guids in a query string param for a product detail page so the real url is like /WebStore/ProductDetail.aspx?pageid=x&mid=y&product=z , but the user does not see the parameters, they see the friendly url like /productname.aspx, but the parameters are really passed because they are kept with the friendly url's real url mapping.

Hope that helps,

Joe

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