GuestBook First Submission

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.
11/18/2010 11:33:33 PM
Gravatar
Total Posts 3

GuestBook First Submission

Hello Joe,

Thank you for creating all of these terrific tutorial and the in-depth documentation.

I have been following your tutorials and while doing this one, http://www.mojoportal.com/dev-series-14-first-guestbook-submission.aspx, I ran into an issue.

Two entries were being adding into my MSSQL database every time. I used breakpoints and stepped through the code, but I wasn't able to ascertain what the issues was.

I believe it may have something to do with Response.RawURL, I am not sure.

Any advise you have will be greatly appreciated.

11/19/2010 2:44:52 AM
Gravatar
Total Posts 3

Re: GuestBook First Submission

I just wanted to provide some extra information:

I placed breakpoints and stepped over the code while querying the database through each step. The Save() method in the btnSubmit event handler did run twice for some reason; hence, causing the duplicate queries.

11/19/2010 8:42:34 AM
Gravatar
Total Posts 18439

Re: GuestBook First Submission

Most likely the events are wired up twice so they fire twice. If you wire up the events in OnInit then you need to set AutoEventWireup="false" in the top of the .ascx or .aspx file

Hope it helps,

Joe

11/19/2010 5:07:39 PM
Gravatar
Total Posts 3

Re: GuestBook First Submission

Hello Joe,

I looked at my GuestBook.ascx file and the AutoEventWireUp was set to false; however, I noticed something incorrect in my markup.

 <asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click />

I double clicked the button in the VS WYSIWYG to create the event handler, out of habit. I also then subscribed to the button click again in OnInit() per your video.

I removed OnClick="btnSubmit_Click", recompiled and it worked perfectly.

Thanks again!

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