Friendly URL and postbacks

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.
12/11/2006 11:53:12 PM
Gravatar
Total Posts 488

Friendly URL and postbacks

I write my own module, then register it and put on a page.
There is a button on the module. After postback I see /Default.aspx?pageid=14 instead of friendly URL.
What should I do to make the friendly URL "stay" in the browser's address line?
12/12/2006 4:51:34 AM
Gravatar
Total Posts 18439

Re: Friendly URL and postbacks

Yes I am aware of this issue. It happens also in the blog module when a user clicks the calendar. My recommendation is to avoid postback in the ModuleControl and link to edit pages instead and do postback there as needed. I would like to eliminate the postback in the blog module control as well. The Module Control is just the entry point to a feature and it can be on a page with other module controls so when it does postback it can cause unexpected side effects for other modules that might be on the same page. For example some module have if(!IsPostBack){ PopulateControls();}, if another module causes the page to post back modules that have this code disappear from the page. Also modules that use postback can't be cached without breaking the functionality.

Another alternative might be to wrap a MagicAjax Panel around the controls in your module which will make it do an ajax partial postback instead of posting back the entire page

<ajax:AjaxPanel id="pnlMyModule" runat="server">
your controls go here

</ajax:AjaxPanel>

This might be a more elegant solution, though I really haven't tried it in a module control yet I think it should work.

Hope it helps,

Joe
12/13/2006 11:43:13 AM
Gravatar
Total Posts 4

Re: Friendly URL and postbacks

I don't know if the internals of MojoPortal allow this, but in Cuyahoga, I was able to fix this pretty easily with the following solution: http://weblogs.asp.net/jezell/archive/2004/03/15/90045.aspx.
You must sign in to post in the forums. This thread is closed to new posts.