473,385 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

change of session does not fire button click event for second time

This button click is fired for first time, but does not get fired for second
time if I click. It again fires 3rd time, but not 4th time and so on..
I want to button to be fired everytime.
I want to add new valyes to my Session of ArrayList type when Button is
clicked.

Can anyone help? Please let me know what I am doing wrong. Here is a sample
call:
private void oButton_Click(object sender, System.EventArgs e)
{

if (oPictureKeys.Count > 0) //loaded ArrayList Keys from database
Session["_Session_PictureKey"] = oPictureKeys; //Always have values
if (HttpContext.Current.Session["_Session_PictureKey"] != null)
{
ArrayList oList=null;
string szNewKey = "NewPictureKey"; //New key I want to insert
to Session
oList = (ArrayList)(Session["_Session_PictureKey"]);
oList.Add(szNewKey);
Session["_Session_PictureKey"]=oList;
}
}
Nov 19 '05 #1
3 1834
Did you verify the behavior with the Visual Studio debugger?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 4 Apr 2005 10:15:05 -0700, "N. Shehzad" <N.
Sh*****@discussions.microsoft.com> wrote:
This button click is fired for first time, but does not get fired for second
time if I click. It again fires 3rd time, but not 4th time and so on..
I want to button to be fired everytime.
I want to add new valyes to my Session of ArrayList type when Button is
clicked.

Can anyone help? Please let me know what I am doing wrong. Here is a sample
call:
private void oButton_Click(object sender, System.EventArgs e)
{

if (oPictureKeys.Count > 0) //loaded ArrayList Keys from database
Session["_Session_PictureKey"] = oPictureKeys; //Always have values
if (HttpContext.Current.Session["_Session_PictureKey"] != null)
{
ArrayList oList=null;
string szNewKey = "NewPictureKey"; //New key I want to insert
to Session
oList = (ArrayList)(Session["_Session_PictureKey"]);
oList.Add(szNewKey);
Session["_Session_PictureKey"]=oList;
}
}


Nov 19 '05 #2
How can I do that?
Why would the button not fire consistently when session value changes?
Can anyone elaborate on this? Is this a bug?
thanks
"Scott Allen" wrote:
Did you verify the behavior with the Visual Studio debugger?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 4 Apr 2005 10:15:05 -0700, "N. Shehzad" <N.
Sh*****@discussions.microsoft.com> wrote:
This button click is fired for first time, but does not get fired for second
time if I click. It again fires 3rd time, but not 4th time and so on..
I want to button to be fired everytime.
I want to add new valyes to my Session of ArrayList type when Button is
clicked.

Can anyone help? Please let me know what I am doing wrong. Here is a sample
call:
private void oButton_Click(object sender, System.EventArgs e)
{

if (oPictureKeys.Count > 0) //loaded ArrayList Keys from database
Session["_Session_PictureKey"] = oPictureKeys; //Always have values
if (HttpContext.Current.Session["_Session_PictureKey"] != null)
{
ArrayList oList=null;
string szNewKey = "NewPictureKey"; //New key I want to insert
to Session
oList = (ArrayList)(Session["_Session_PictureKey"]);
oList.Add(szNewKey);
Session["_Session_PictureKey"]=oList;
}
}


Nov 19 '05 #3
There is some basic documentation on debugging here:

http://msdn.microsoft.com/library/de...pplication.asp

Looking at just this section of code impossible to guess what the
problem is. Perhaps oPicutreKeys.Count is 0?

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Tue, 5 Apr 2005 09:05:08 -0700, "N. Shehzad"
<NS******@discussions.microsoft.com> wrote:
How can I do that?
Why would the button not fire consistently when session value changes?
Can anyone elaborate on this? Is this a bug?
thanks
"Scott Allen" wrote:
Did you verify the behavior with the Visual Studio debugger?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 4 Apr 2005 10:15:05 -0700, "N. Shehzad" <N.
Sh*****@discussions.microsoft.com> wrote:
>This button click is fired for first time, but does not get fired for second
>time if I click. It again fires 3rd time, but not 4th time and so on..
>I want to button to be fired everytime.
>I want to add new valyes to my Session of ArrayList type when Button is
>clicked.
>
> Can anyone help? Please let me know what I am doing wrong. Here is a sample
>call:
>
>
>private void oButton_Click(object sender, System.EventArgs e)
>{
>
>if (oPictureKeys.Count > 0) //loaded ArrayList Keys from database
>Session["_Session_PictureKey"] = oPictureKeys; //Always have values
>
>
> if (HttpContext.Current.Session["_Session_PictureKey"] != null)
> {
> ArrayList oList=null;
> string szNewKey = "NewPictureKey"; //New key I want to insert
>to Session
> oList = (ArrayList)(Session["_Session_PictureKey"]);
> oList.Add(szNewKey);
> Session["_Session_PictureKey"]=oList;
> }
>}



Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: N. Shehzad | last post by:
This button click is fired for first time, but does not get fired for second time if I click. It again fires 3rd time, but not 4th time and so on.. I want to button to be fired everytime. I want...
6
by: Mark | last post by:
I have been working for quite some time on this issue which in theory should be quite simple. The problem is that the Cancel and Save events are not fired when their respective buttons are...
2
by: makthar | last post by:
Thanks for taking the time to read this note Can anyone explain what went wrong and any ideas how to fix it I have a search page With three buttons few drop downs and a textbox. The search...
0
by: tshad | last post by:
I am trying to figure out how to handle a couple of problem using multiple events tied to the same button. Following is the button: <asp:button ID="submitAnswer" CommandName="SubmitAnswer"...
5
by: Verde | last post by:
This is admittedly an apparently odd request... but please indulge me if you don't mind: Suppose I have two <asp:Button.../> on a page (Button1 and Button2). User clicks Button1 and triggers a...
0
by: Janet Collins | last post by:
I have a button on a user control on a form. I have the Click event wired to an event handler. The first time I click the button, the page postsback, but does not invoke my event handler. ...
3
by: Phillip N Rounds | last post by:
I'm writing a user control which has two states: Active & InActive. I additionally am required that there to be only one active control per page, and all logic has to be contained within the...
2
by: Stuart Whiteford | last post by:
Hi, I asked this back in January without answer and forgot about it until now. I've got a basic web form, two textboxes, a couple of radio button groups, some required field validators, and a...
2
by: Joergen Bech | last post by:
Hope someone has a solution or some suggestions for this. This cannot be right?!? Problem: I have multiple non-modal forms open at the same time. One or more of these forms have a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.