Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I want to design a ASP.Net form for feedback/Complaint page.
My requirement is:
* There sholud be two radio buttons on the top of the page.(1 is for old Complaints and another is for new complaint.)
* When user clicks on old complaints then a textbox will be displayed and asking for "Your Complaint ID". When user enters the complaint ID and submits then the details of the complaint is shown.
* When user clicks on new Complaint then fields for Name,Roll Number and email with Subject and message are shown. When user will submit the form it will show a confirmation that thank you for feedback and a mail should go to the user that your feedback/Complaint ID is "complaintid".
* All data should store in database and retrieve also from database.
 
Please help me out i am unable to do the automatic ID generation part while submitting and the email part.
Thank You.
Posted 1-May-13 21:11pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

-Have multiview control in your page with two views.Change the view according to selected value of the Radiobutton.
-When you select NEW COMPLAINT,then your second view will be displayed as below.
 
<asp:multiview id="MultiView1" runat="server" xmlns:asp="#unknown">
                <asp:view id="View1" runat="server">
                /*old complaint section*/
                </asp:view>
                <asp:view id="View2" runat="server">
                <table>
                    <tr>
                        <td>
                            Name
                        </td>
                        <td>textbox</td>
                    </tr>
                     <tr>
                        <td>
                             Roll No.
                        </td>
                        <td>textbox</td>
                    </tr>
                     <tr>
                        <td>
                           Subject
                        </td>
                        <td>textbox</td>
                    </tr>                     
                     <tr>
                        <td>
                           Message
                        </td>
                        <td>textbox</td>
                    </tr>
                    <tr>
                        <td>button</td>
                    </tr>
                </table></asp:view>
</asp:multiview>
 
on click event of the button.
 
string code1 = Guid.NewGuid().ToString();/*you can generate random numbers with other methods also*/
using (MailMessage message = new MailMessage())
{
          message.IsBodyHtml = true;
          message.From = new MailAddress(from which you want to send mail);
          message.To.Add(new MailAddress(to which you want to send mail));
          message.Subject = subject here;
          message.Body =body text here;
          SmtpClient smtp = new SmtpClient();
          smtp.Host = "host";
          smtp.Credentials = new System.Net.NetworkCredential(username, password);/*you can also define this in web config file*/
          smtp.EnableSsl = false;
          smtp.Send(message);
          Response.Write("<script type='text/javascript'>");
          Response.Write("alert('Thanks for feedback.');");          
          Response.Write("</script>");
}
  Permalink  
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 562
1 Sergey Alexandrovich Kryukov 484
2 Maciej Los 325
3 DamithSL 233
4 Mathew Soji 195
0 OriginalGriff 7,168
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,461
3 Manas Bhardwaj 4,876
4 Maciej Los 4,450


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 2 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100