Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 7th, 2012, 12:24 PM
Authorized User
Points: 112, Level: 2
Points: 112, Level: 2 Points: 112, Level: 2 Points: 112, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default asp.net session ends abruptly

My asp.net session ends abruptly after i perform a delete operation on database.
please note that i am using Inproc mode for session management and not the database. please help its urgent
  #2 (permalink)  
Old December 8th, 2012, 01:45 PM
Authorized User
Points: 112, Level: 2
Points: 112, Level: 2 Points: 112, Level: 2 Points: 112, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

please help its urgent
  #3 (permalink)  
Old December 9th, 2012, 07:35 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

If it's urgent, you better supply more relevant information, such as your site's setup, the code you're using, the results of debugging your code and so on.

Based on what you've provided so far it's impossible to help you. Database updates don't end sessions so there must be something in your code or configuration that's causing this. What it is, is impossible to say without more information.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #4 (permalink)  
Old December 9th, 2012, 11:34 PM
Authorized User
Points: 112, Level: 2
Points: 112, Level: 2 Points: 112, Level: 2 Points: 112, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i have a cms system, after a user logins to the system, there is a page with a gridview hwich has a column of checkboxes in it. there is a button on the page to delete records selected in the gridview using the checkbox. when press on this button, the records get deleted. now there is also a column of edit buttons in the gridview. after the delete operation, when i click on the edit button, the session ends i am redirected to the login page, here's the code for delete button:-
Code:
try
        {
            string id = string.Empty;
            foreach (GridViewRow gv in GridView1.Rows)
            {
                CheckBox chkselectItem = (CheckBox)gv.FindControl("CheckBox1");
                if (chkselectItem.Checked)
                {
                    id = ((DataKey)GridView1.DataKeys[gv.RowIndex]).Value.ToString();
                    chkid.Add(id);
                }
            }
            if (chkid.Count <= 0)
            {
                lblMessage.Text = "Please Select a Meeting to delete";
            }
            else
            {
                for (int i = 0; i < chkid.Count; i++)
                {
                    DeleteMeeting(chkid[i].ToString());
                    string query = "delete from tblBMeeting where id=" + chkid[i].ToString();
                    int res = dba.Insert(query);
                    if (res == 0)
                    {
                        //DeleteMeeting(chkid[i].ToString());
                        lblMessage.Text += "Meeting Removed";
                    }
                    else
                    {
                        //lblMessage.Text = query;
                        break;
                    }
                }
            }
            fillGrid(ddlForums.SelectedValue);
        }
        catch (Exception ex)
        {
            ErrorLoging.logerror(ex.Message, "Meetings");
        }
here's the code for validating Session in master page.
Code:
if (String.IsNullOrEmpty((String)Session["user"]))
                FormsAuthentication.RedirectToLoginPage();
  #5 (permalink)  
Old December 10th, 2012, 09:38 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

I don't see any code that could explain the problem you're having. Maybe the error handling module changes the session state?

Also, why are you using session variables to keep track of a logged in user when you're also using forms authentication? More of a side question; not directly related to your problem at hand though.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maintain the session in asp.net samgaya1983 ASP.NET 2.0 Professional 2 June 29th, 2007 03:37 AM
ASP.Net without session. soccers_guy10 ASP.NET 1.0 and 1.1 Professional 1 May 8th, 2007 05:49 AM
how to update a database when asp.net session ends connect2sandep ASP.NET 1.0 and 1.1 Professional 3 October 30th, 2005 04:46 PM
session variables in asp to asp.net marvz ASP.NET 2.0 Basics 0 August 1st, 2005 03:09 AM



All times are GMT -4. The time now is 10:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.