please help

d2005

Active member
Joined
Aug 31, 2005
Messages
37
Location
ireland
Programming Experience
Beginner
loop of if statement

i want to make a beep every time the row count on my datagrid is incremented
i can count the rows as an integer no problem
but i cant seem to work out how to keep this value and check if it has been incremented on page load and if it has then beep()

anyone can help me

need somekind of if statement
 

suddenelfilio

Well-known member
Joined
Jun 3, 2004
Messages
144
Location
Belgium
Programming Experience
5-10
Why not keep the integer in a session variable you can check it on the other page.

example:
On page1

Dim i as integer

i = 4
session("counter") = i

On page 2

dim i as integer = session("counter")
me.label1.text = i.ToString()

--> the text of the label will be 4
 

d2005

Active member
Joined
Aug 31, 2005
Messages
37
Location
ireland
Programming Experience
Beginner
i dont think i fully understand this, are there any examples online that you know of, thanks
 

suddenelfilio

Well-known member
Joined
Jun 3, 2004
Messages
144
Location
Belgium
Programming Experience
5-10
a session variable is a variable you declare anywhere and in return can use anyware (after declaration). When you have two pages page1.aspx and page2.aspx

when you declare the session variable "counter" you can just assign it a value like this: session("counter") = 4. What you assign to a session variable can be anything string, integer even a custom object.

now the session variable is declared it can be accessed anywhere in your project for example I want on page2.aspx to use the value I assigned to the session variable I can reuse it by just assigning its value: dim i as integer = session("counter").
i will now have 4 as value. should you change the variable like this session("counter") = 5 and you return to page1.aspx when you do this response.write(session("counter")) it will print 5 on top of the webpage.

A session variable is a accessible global per user session. When the user closes the browser the values in these variables are lost. If you want to avoid this you can use application variables.

Sorry don't have any concrete examples on this. Google for "Session variables and application values asp.net" for some satisfying results!
 

d2005

Active member
Joined
Aug 31, 2005
Messages
37
Location
ireland
Programming Experience
Beginner
got it working buddy thanks
i am writing the value out to the parent form then back to the child form,
it is a whole handlin

thanks you
 
Top Bottom