Click here to Skip to main content
12,815,019 members (39,903 online)
   

ASP.NET

 
AnswerRe: ASP MVC update panel Pin
mayankgupta68828-Nov-12 16:23
membermayankgupta68828-Nov-12 16:23 
SuggestionIf we click DropDownList items Automatically Select Second DropdownLIst in gridview? Pin
hemanth sutapalli26-Nov-12 1:44
memberhemanth sutapalli26-Nov-12 1:44 
GeneralRe: If we click DropDownList items Automatically Select Second DropdownLIst in gridview? Pin
Ali Al Omairi(Abu AlHassan)26-Nov-12 20:21
memberAli Al Omairi(Abu AlHassan)26-Nov-12 20:21 
GeneralRe: If we click DropDownList items Automatically Select Second DropdownLIst in gridview? Pin
Robert Bettinelli3-Dec-12 16:25
memberRobert Bettinelli3-Dec-12 16:25 
QuestionYahoo Wweather: XMLDOCUMENT, XPATHDOCUMENT or ... Pin
Jassim Rahma26-Nov-12 0:12
memberJassim Rahma26-Nov-12 0:12 
QuestionClickonce deployment Pin
kareem olamilekan25-Nov-12 14:07
memberkareem olamilekan25-Nov-12 14:07 
AnswerRe: Clickonce deployment Pin
Keith Barrow26-Nov-12 3:40
mentorKeith Barrow26-Nov-12 3:40 
Questionwhy it's adding this to the database?!! Pin
jrahma24-Nov-12 12:16
memberjrahma24-Nov-12 12:16 
I have the following class code to add support ticket:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using MySql.Data;
using MySql.Data.MySqlClient;
using System.Configuration;
using System.Globalization;
using Microsoft.Win32;
using System.Diagnostics;
using System.Reflection;
using System.IO;
using System.Security.Cryptography;
using DevExpress.Web.ASPxUploadControl;
using System.Drawing;
using System.Net;
using System.Net.Mail;
using System.Text;

namespace volow
{
    public class create_support_ticket
    {
        MySqlConnection support_sql_connection = null;
        MySqlCommand support_sql_command = null;
        // MySqlDataAdapter event_log_sql_adapter;
        // DataTable data_table = null;
        // MySqlDataReader event_log_sql_reader = null;
        // MySqlDataReader sql_block_reader = null;
        // DataSet event_log_data_set = null;

        public void add_support_ticket(string support_incident_title, string email_address, string support_ticket_description)
        {
            support_sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
            support_sql_connection.Open();
            support_sql_command = new MySqlCommand("sp_add_support_ticket", support_sql_connection);
            support_sql_command.CommandType = CommandType.StoredProcedure;

            support_sql_command.Parameters.Add("param_support_incident_title", MySqlDbType.VarChar).Value = support_incident_title;
            support_sql_command.Parameters.Add("param_email_address", MySqlDbType.VarChar).Value = email_address;
            support_sql_command.Parameters.Add("param_support_ticket_description", MySqlDbType.Text).Value = support_ticket_description;

            int result_rows = support_sql_command.ExecuteNonQuery();

            support_sql_command.Dispose();
            support_sql_connection.Close();

            HttpContext.Current.Session["message_title"] = "Thank you";
            HttpContext.Current.Session["message_title_Color"] = Color.Blue.ToArgb();
            HttpContext.Current.Session["message_text"] = "We have recieved your feedback and we will get back to you as soon as possible.";
            HttpContext.Current.Session["message_button_title"] = "Back";
            HttpContext.Current.Session["message_button_url"] = "Home.aspx";

            if (!HttpContext.Current.Request.Path.EndsWith("Message.aspx", StringComparison.InvariantCultureIgnoreCase))
                HttpContext.Current.Response.Redirect("Message.aspx");

            // HttpContext.Current.Response.Redirect("Message.aspx");
        }
    }
}


and I am calling it from the webform like this:

protected void btnSend_Click(object sender, EventArgs e)
{
    if (txtMessage.Text == "")
    {
        Session["message_title"] = "Error";
        Session["message_title_Color"] = Color.Red.ToArgb();
        Session["message_text"] = "Please enter your message.";
        Session["message_button_title"] = "Back";
        Session["message_button_url"] = Request.UrlReferrer.ToString();
    }

    create_support_ticket create_support_ticket = new create_support_ticket();
    create_support_ticket.add_support_ticket(txtSubject.Text, txtEmailAddress.Text, txtMessage.XHTML);
}


but I am getting two rows added for every insert! Thsi first row is correct as per the passed information but the second row adding the Session["message_title"] as support_incdent_title and the Session["message_text"] as support_ticket_description and I really don't know how??

here is my stored procedure:

INSERT INTO support_incidents (support_incident_title, email_address) VALUES (param_support_incident_title, param_email_address);
INSERT INTO support_tickets (support_incident_id, support_ticket_description) VALUES (LAST_INSERT_ID(), param_support_ticket_description);

AnswerRe: why it's adding this to the database?!! Pin
jkirkerx24-Nov-12 19:10
memberjkirkerx24-Nov-12 19:10 
Question(This webpage has a redirect loop) Problem Pin
jrahma24-Nov-12 12:05
memberjrahma24-Nov-12 12:05 
AnswerRe: (This webpage has a redirect loop) Problem Pin
jkirkerx24-Nov-12 19:21
memberjkirkerx24-Nov-12 19:21 
SuggestionShould i change my asked question? Pin
anglo007223-Nov-12 23:29
memberanglo007223-Nov-12 23:29 
GeneralI'm find C# asp.net linkedin sample code Pin
Serdar Şengül22-Nov-12 22:14
memberSerdar Şengül22-Nov-12 22:14 
GeneralRe: I'm find C# asp.net linkedin sample code Pin
Richard MacCutchan23-Nov-12 0:57
mvpRichard MacCutchan23-Nov-12 0:57 
GeneralRe: I'm find C# asp.net linkedin sample code Pin
CommDev9-Dec-12 0:23
memberCommDev9-Dec-12 0:23 
QuestionPaypal Website Payments Standard Integration using NVP Pin
Zaf Khan22-Nov-12 19:21
memberZaf Khan22-Nov-12 19:21 
AnswerRe: Paypal Website Payments Standard Integration using NVP Pin
jkirkerx24-Nov-12 20:59
memberjkirkerx24-Nov-12 20:59 
GeneralRe: Paypal Website Payments Standard Integration using NVP Pin
Zaf Khan24-Nov-12 23:07
memberZaf Khan24-Nov-12 23:07 
GeneralRe: Paypal Website Payments Standard Integration using NVP Pin
jkirkerx25-Nov-12 9:08
memberjkirkerx25-Nov-12 9:08 
GeneralRe: Paypal Website Payments Standard Integration using NVP Pin
Zaf Khan25-Nov-12 20:44
memberZaf Khan25-Nov-12 20:44 
QuestionProblem With List View Pin
ggaurav bhandari22-Nov-12 3:09
memberggaurav bhandari22-Nov-12 3:09 
AnswerRe: Problem With List View Pin
Parwej Ahamad22-Nov-12 7:08
memberParwej Ahamad22-Nov-12 7:08 
GeneralRe: Problem With List View Pin
d0cvb22-Nov-12 11:28
memberd0cvb22-Nov-12 11:28 
GeneralRe: Problem With List View Pin
Parwej Ahamad22-Nov-12 19:35
memberParwej Ahamad22-Nov-12 19:35 
QuestionChecking the size of a cookie Pin
suzyb22-Nov-12 2:46
membersuzyb22-Nov-12 2:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 22 Mar 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid