Click here to Skip to main content
11,479,841 members (49,936 online)
   

ASP.NET

 
QuestionRe: a control that should contain html elements Pin
jkirkerx24-Dec-12 14:09
memberjkirkerx24-Dec-12 14:09 
AnswerRe: a control that should contain html elements Pin
Ali Al Omairi(Abu AlHassan)25-Dec-12 20:51
memberAli Al Omairi(Abu AlHassan)25-Dec-12 20:51 
Questioncheckedchange event of gridview in javascript Pin
Ravi_kant23-Dec-12 20:29
memberRavi_kant23-Dec-12 20:29 
AnswerRe: checkedchange event of gridview in javascript Pin
Sampath Kumar Sathiya24-Dec-12 1:20
memberSampath Kumar Sathiya24-Dec-12 1:20 
GeneralRe: checkedchange event of gridview in javascript Pin
Ravi_kant24-Dec-12 8:40
memberRavi_kant24-Dec-12 8:40 
Questionupdated data from gridview Pin
Member 970720723-Dec-12 1:30
memberMember 970720723-Dec-12 1:30 
AnswerRe: updated data from gridview Pin
Ali Al Omairi(Abu AlHassan)24-Dec-12 5:31
memberAli Al Omairi(Abu AlHassan)24-Dec-12 5:31 
AnswerRe: updated data from gridview Pin
Sandeep Mewara25-Dec-12 20:35
mvpSandeep Mewara25-Dec-12 20:35 
Question.net question Pin
Tarani Dutt Joshi22-Dec-12 0:53
memberTarani Dutt Joshi22-Dec-12 0:53 
AnswerRe: .net question Pin
Richard MacCutchan22-Dec-12 1:18
mvpRichard MacCutchan22-Dec-12 1:18 
AnswerRe: .net question Pin
MaulikDusara24-Dec-12 22:38
memberMaulikDusara24-Dec-12 22:38 
AnswerRe: .net question Pin
Sandeep Mewara25-Dec-12 20:33
mvpSandeep Mewara25-Dec-12 20:33 
QuestionWebRequest Pin
cdpsource21-Dec-12 15:16
membercdpsource21-Dec-12 15:16 
Questionwebpage has resulted in too many redirects Pin
Jassim Rahma21-Dec-12 10:46
memberJassim Rahma21-Dec-12 10:46 
Hi,

Why I am getting this error when insert is successful?!!! it should redirect to ~/Channels!

here is my code:

try
{
    sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
    sql_connection.Open();
                
    if (RouteData.Values["GUID"].ToString() == "New") sql_command = new MySqlCommand("sp_add_new_channel", sql_connection);
    else sql_command = new MySqlCommand("sp_update_channel", sql_connection);
                
    sql_command.CommandType = CommandType.StoredProcedure;
 
    if (RouteData.Values["GUID"].ToString() == "New") sql_command.Parameters.AddWithValue("param_member_id", Convert.ToInt32(Session["member_id"])).MySqlDbType = MySqlDbType.Int32; 
    else sql_command.Parameters.AddWithValue("param_channel_guid", RouteData.Values["GUID"].ToString()).MySqlDbType = MySqlDbType.VarChar;                
 
    sql_command.Parameters.AddWithValue("param_channel_name", txtChannelName.Text.Trim()).MySqlDbType = MySqlDbType.VarChar;
    sql_command.Parameters.AddWithValue("param_channel_address", txtChannelAddress.Text.Trim()).MySqlDbType = MySqlDbType.VarChar;
    sql_command.Parameters.AddWithValue("param_channel_language", Convert.ToInt32(cboLanguage.Value)).MySqlDbType = MySqlDbType.Int32;
    sql_command.Parameters.AddWithValue("param_channel_description", txtChannelDescription.Text.Trim()).MySqlDbType = MySqlDbType.VarChar;
    sql_command.Parameters.AddWithValue("param_channel_allow_comment", chkAllowComment.Checked).MySqlDbType = MySqlDbType.Bit;
    sql_command.Parameters.AddWithValue("param_channel_allow_like", chkAllowLikeIt.Checked).MySqlDbType = MySqlDbType.Bit;
    sql_command.Parameters.AddWithValue("param_channel_allow_share", chkAllowShare.Checked).MySqlDbType = MySqlDbType.Bit;
    sql_command.Parameters.AddWithValue("param_show_profile_photo", chkShowProfilePhoto.Checked).MySqlDbType = MySqlDbType.Bit;
    if (RouteData.Values["GUID"].ToString() == "New") sql_command.Parameters.Add("param_channel_guid", MySqlDbType.VarChar).Direction = ParameterDirection.Output;
    sql_command.Parameters.Add("param_is_exist", MySqlDbType.Bit).Direction = ParameterDirection.Output;                
 
    // execute the query;
    int result_rows = sql_command.ExecuteNonQuery();
 
    if (Convert.ToBoolean(sql_command.Parameters["param_is_exist"].Value) != true)
    {
        // member_id = sql_command.Parameters["param_record_identity"].Value.ToString();
        // member_guid = sql_command.Parameters["param_record_guid"].Value.ToString();
        // activation_code = sql_command.Parameters["param_activation_code"].Value.ToString();

        website_event_log.add_event_log("Membership", txtChannelName.Text.Trim(), "You have successfully signed up");
 
        Response.Redirect("~/Channels", true);
    }
    else
    {
        Session["message_title"] = "Error";
        Session["message_title_Color"] = Color.Red.ToArgb();
        Session["message_text"] = "The same channel address already exists. Please try another address.";
        Session["message_button_title"] = "Back";
        Session["message_button_url"] = Request.UrlReferrer.ToString();
 
        Response.Redirect("~/Message", false);
    }
}
catch (Exception exp)
{
    Session["message_title"] = "ERROR..";
    Session["message_text"] = String.Format("Please try again.......{0}{1}", "", exp.Message);
    Session["message_button_title"] = "Back to Sign-in";
    Session["message_button_url"] = Request.UrlReferrer.ToString();
 
    Response.Redirect("~/Message", false);
}
finally
{
    // if (sql_reader != null) sql_reader.Close();
    if (sql_connection != null)
    {
        if (sql_connection.State == ConnectionState.Open)
            sql_connection.Close();
    }
}


Technology News @ www.JassimRahma.com

AnswerRe: webpage has resulted in too many redirects Pin
jkirkerx22-Dec-12 19:50
memberjkirkerx22-Dec-12 19:50 
GeneralRe: webpage has resulted in too many redirects Pin
Jassim Rahma23-Dec-12 9:36
memberJassim Rahma23-Dec-12 9:36 
GeneralRe: webpage has resulted in too many redirects Pin
jkirkerx23-Dec-12 9:47
memberjkirkerx23-Dec-12 9:47 
GeneralRe: webpage has resulted in too many redirects Pin
Jassim Rahma24-Dec-12 10:10
memberJassim Rahma24-Dec-12 10:10 
GeneralRe: webpage has resulted in too many redirects Pin
jkirkerx24-Dec-12 14:05
memberjkirkerx24-Dec-12 14:05 
Questionpop up on mouse over on a image button Pin
Yasir88721-Dec-12 7:42
memberYasir88721-Dec-12 7:42 
AnswerRe: pop up on mouse over on a image button Pin
AnalogNerd21-Dec-12 10:26
memberAnalogNerd21-Dec-12 10:26 
GeneralRe: pop up on mouse over on a image button Pin
Yasir88721-Dec-12 18:09
memberYasir88721-Dec-12 18:09 
AnswerRe: pop up on mouse over on a image button Pin
n.podbielski22-Dec-12 22:50
membern.podbielski22-Dec-12 22:50 
AnswerRe: pop up on mouse over on a image button [modified] Pin
CommDev23-Dec-12 15:35
memberCommDev23-Dec-12 15:35 
Questionasp.net Pin
Nitin Pant20-Dec-12 22:43
memberNitin Pant20-Dec-12 22:43 
AnswerRe: asp.net Pin
Richard MacCutchan20-Dec-12 23:57
mvpRichard MacCutchan20-Dec-12 23:57 
RantRe: asp.net Pin
Richard Deeming21-Dec-12 2:31
memberRichard Deeming21-Dec-12 2:31 
GeneralRe: asp.net Pin
Richard MacCutchan21-Dec-12 3:04
mvpRichard MacCutchan21-Dec-12 3:04 
JokeRe: asp.net Pin
n.podbielski22-Dec-12 22:54
membern.podbielski22-Dec-12 22:54 
AnswerRe: asp.net Pin
J4amieC21-Dec-12 0:26
memberJ4amieC21-Dec-12 0:26 
AnswerRe: asp.net Pin
ProgramFOX21-Dec-12 0:52
memberProgramFOX21-Dec-12 0:52 
AnswerRe: asp.net [modified] Pin
CommDev23-Dec-12 15:15
memberCommDev23-Dec-12 15:15 
QuestionProblem with change Gridview cell value [modified] Pin
jojoba201120-Dec-12 0:24
memberjojoba201120-Dec-12 0:24 
AnswerRe: Problem with change Gridview cell value [modified] Pin
CommDev23-Dec-12 15:24
memberCommDev23-Dec-12 15:24 
QuestionHow to add anchor tag in uploded html page Pin
VyasRavi677619-Dec-12 19:54
memberVyasRavi677619-Dec-12 19:54 
AnswerRe: How to add anchor tag in uploded html page Pin
@AmitGajjar20-Dec-12 6:39
member@AmitGajjar20-Dec-12 6:39 
GeneralRe: How to add anchor tag in uploded html page Pin
chirag774920-Dec-12 22:34
memberchirag774920-Dec-12 22:34 
AnswerRe: How to add anchor tag in uploded html page [modified] Pin
CommDev20-Dec-12 21:04
memberCommDev20-Dec-12 21:04 
GeneralRe: How to add anchor tag in uploded html page Pin
chirag774920-Dec-12 21:14
memberchirag774920-Dec-12 21:14 
GeneralRe: How to add anchor tag in uploded html page Pin
n.podbielski22-Dec-12 22:57
membern.podbielski22-Dec-12 22:57 
GeneralRe: How to add anchor tag in uploded html page Pin
n.podbielski22-Dec-12 22:57
membern.podbielski22-Dec-12 22:57 
Questionjquery for asp.net sometimes work sometimes doesn't work [modified] Pin
Dhyanga19-Dec-12 12:57
memberDhyanga19-Dec-12 12:57 
AnswerRe: jquery for asp.net sometimes work sometimes doesn't work Pin
jkirkerx19-Dec-12 18:25
memberjkirkerx19-Dec-12 18:25 
GeneralRe: jquery for asp.net sometimes work sometimes doesn't work Pin
Dhyanga19-Dec-12 18:50
memberDhyanga19-Dec-12 18:50 
AnswerRe: jquery for asp.net sometimes work sometimes doesn't work Pin
jkirkerx19-Dec-12 19:09
memberjkirkerx19-Dec-12 19:09 
QuestionOnly 1 use for admin? Pin
xnaLearner19-Dec-12 2:28
memberxnaLearner19-Dec-12 2:28 
QuestionHave userID in view, need userName posted Pin
xnaLearner19-Dec-12 1:41
memberxnaLearner19-Dec-12 1:41 
AnswerRe: Have userID in view, need userName posted Pin
Matt U.19-Dec-12 5:11
memberMatt U.19-Dec-12 5:11 
AnswerRe: Have userID in view, need userName posted [modified] Pin
CommDev20-Dec-12 23:55
memberCommDev20-Dec-12 23:55 
QuestionUnable to start program http://localhost:1837/default.aspx using VS 2008 in Windows XP IE 8 Pin
sr15919-Dec-12 1:08
membersr15919-Dec-12 1:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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.150520.1 | Last Updated 22 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid