Contact Form creation help?

Posted on 2005-05-03
Last Modified: 2010-04-07
Hi there,

i have just created a contact form on my contact.aspx, it uses code behind. so what i intended to was this

Create 1 panel (asp control) and place tables, textboxes etc into this

Create another panel (asp control) and place 2 confirmation msgs i.e. "Confirmed!", and "OOps a problem, couldn't send mail"

Now i think i am going down the right way? Basically i make panel 1 visibal but on postback i make panel 1 invisible and then make panel 2 visible.

Panel 2 will then either say "Confirmed" or "NOT" .. my question is,.. is this correct and how to do i switch between the 2 different msgs in panel 2?

Should i use a standard Label control(asp control) , i.e. label 1 and label 2... and then make either label1 or label2 invisible depending on the outcome OR use more panels, i think panels carry quite alot of overhead?

Any ideas or advice would be really appreciated

Question by:ianinspain
    LVL 26

    Accepted Solution

    a better option would be to show message to the user in the form of a messagebox and always show the textboxes etc in ur panel one .. so that he can see what he has posted and the reason for the error.. for that u can use the following code

    Dim lstrScript as string = "<Script langauge = javascript>" & vbcrlf

    if error occured .. some logic u already have
              lstrScript += "alert('OOps a problem, couldn't send mail');"
              lstrScript += "alert('Confirmed');"
    end if
    lstrScript += "</Script>"

    RegisterStartupScript("Message", lstrScript)

    no need to use panels and make them visible and invisible ...
    LVL 26

    Expert Comment

    just note that all this code will be in ur code-behind .. that is the place where u r processing ur code to send the mail etc .. maybe on a button click event or something like that ...

    Author Comment

    Thanks for your comments, but i really want to do it the way displaying different information on the same page depending on the outcome. i want to try and keep away from using pop boxes etc

    Are you aware of the best way to do this using the same page, is using panels good and then controlling what is in the second panel, using another panel or is that too much overhead?

    LVL 26

    Expert Comment

    >>way displaying different information on the same page depending
    The message is indeed displayed in the same page ...

    >> i want to try and keep away from using pop boxes etc,
    what would the reason be .. showing error using messagebox is a standard way to do it and the most efficient .. anyway u might have ur reasons .. using panels would not be too much of a overhead, but managing it would be the problem for u (making it visible/invisible) .. what would happen when u have shown the user the error message in the panel .. what will he have to do to try the process again?

    Author Comment

    Thanks for your help. I did go down the panel route but saved your ideas for future projects.



    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now