Modules

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.
6/3/2009 7:40:46 AM
Gravatar
Total Posts 12

Modules

Hi Joe.. i  just added the contact form and was testing it.. when we do not enter any details and click the send button the form is not saving the data as it should not but it is doing a servrer round trip ans shoowing the error messages of the validation controls. Is it because it is a  usercontol (.ascx) and not a page (aspx). I need to avoid that server round trip . Thanks .

6/3/2009 8:43:13 AM
Gravatar
Total Posts 18439

Re: Modules

Hi,

I just looked into this. The only way to prevent the postback is to comment out this code and rebuild:

UIHelper.DisableButtonAfterClick(
btnSend,
ContactFormResources.ButtonDisabledPleaseWait,
Page.ClientScript.GetPostBackEventReference(this.btnSend, string.Empty)
);

I incvestigated a workaround using code like this:

PostBackOptions postbackOptions = new PostBackOptions(btnSend);
postbackOptions.PerformValidation = true;
postbackOptions.ValidationGroup = "Contact";

UIHelper.DisableButtonAfterClick(
btnSend,
ContactFormResources.ButtonDisabledPleaseWait,
Page.ClientScript.GetPostBackEventReference(postbackOptions)
);

and it worked in terms of preventing the postback but the result was that the button was disabled and the form could not be submitted if client side validation failed.

In this case I don't think we really need the button disabled after clicking so its a good enough solution to just comment that out.

I have made this fix in my copy so it will be fixed in the next release. It was also missing the ValidationGroup="Contact" on the regexvaldiator.

Best,

Joe

6/3/2009 8:48:56 AM
Gravatar
Total Posts 12

Re: Modules

Thanks Joe

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