Hi, Good Day!
I need to create a variable that it's value can be carry across within a
form.
I've created some above the "web form designer generated code" but it seems
not working.
It reset back to nothing when i click on a button.
Can someone help?
Thanks in advanced.
rgds,
Phoebe 8 1378
Public Class Form1
Private sTr as String
Private i as Integer
Your variables get reset when you click a button because the clicking of
that button causes the entire form to be re-created (and therefore reset).
In ASP.NET, by the time the client has received the web page, the server has
completed its processing of that page and unloaded it from memory. Each and
every time the page is requested again (which clicking a button would
cause), the page is created from scratch all over again.
The variables you created, are available anywhere in the programming of the
page, but only while the page is being processed.
"Phoebe." <ph********@hotmail.com> wrote in message
news:u7**************@TK2MSFTNGP11.phx.gbl... Hi, Good Day!
I need to create a variable that it's value can be carry across within a form.
I've created some above the "web form designer generated code" but it
seems not working.
It reset back to nothing when i click on a button.
Can someone help? Thanks in advanced.
rgds, Phoebe
Thanks Carno.
My situation is i have a edit in my datagrid and this trigger
Sub EditRec(Byval objsrc as object, byval objargs as
datagridcommandeventargs)
...
End Sub
I have a Update button which trigger
Sub UpdateRecord(byval sender as system.object, byval e as system.eventargs)
...
End Sub
I need to capture my previous record from Sub EditRec and compare them in
Sub UpdateRecord.
Any idea on how it works?
Thanks in advanced.
rgds,
Phoebe.
"Carno C. Mercado" <on***@webgate.net.ph> wrote in message
news:O$**************@tk2msftngp13.phx.gbl... Public Class Form1 Private sTr as String Private i as Integer . .
' Constructor Public Sub New() sTr = "Test"
End Sub
Public Sub Method1
' here you can see the value of sTr if ( sTr = "Test ) then
end if
end sub
More Functions
End Class
"Phoebe." <ph********@hotmail.com> wrote in message news:u7**************@TK2MSFTNGP11.phx.gbl... Hi, Good Day!
I need to create a variable that it's value can be carry across within a form.
I've created some above the "web form designer generated code" but it seems not working.
It reset back to nothing when i click on a button.
Can someone help? Thanks in advanced.
rgds, Phoebe
In the DataGrid's EditCommand event handler use the eventArgs argument to
determine what row was edited (e.item?).
"Phoebe." <ph********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... Thanks Carno.
My situation is i have a edit in my datagrid and this trigger Sub EditRec(Byval objsrc as object, byval objargs as datagridcommandeventargs) ... End Sub
I have a Update button which trigger Sub UpdateRecord(byval sender as system.object, byval e as
system.eventargs) ... End Sub
I need to capture my previous record from Sub EditRec and compare them in Sub UpdateRecord.
Any idea on how it works? Thanks in advanced.
rgds, Phoebe.
"Carno C. Mercado" <on***@webgate.net.ph> wrote in message news:O$**************@tk2msftngp13.phx.gbl... Public Class Form1 Private sTr as String Private i as Integer . .
' Constructor Public Sub New() sTr = "Test"
End Sub
Public Sub Method1
' here you can see the value of sTr if ( sTr = "Test ) then
end if
end sub
More Functions
End Class
"Phoebe." <ph********@hotmail.com> wrote in message news:u7**************@TK2MSFTNGP11.phx.gbl... Hi, Good Day!
I need to create a variable that it's value can be carry across within
a form.
I've created some above the "web form designer generated code" but it seems not working.
It reset back to nothing when i click on a button.
Can someone help? Thanks in advanced.
rgds, Phoebe
Thanks Scott.
But I need the data that pass to UpdateRecord for comparison.
"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:eG**************@TK2MSFTNGP12.phx.gbl... In the DataGrid's EditCommand event handler use the eventArgs argument to determine what row was edited (e.item?).
"Phoebe." <ph********@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl... Thanks Carno.
My situation is i have a edit in my datagrid and this trigger Sub EditRec(Byval objsrc as object, byval objargs as datagridcommandeventargs) ... End Sub
I have a Update button which trigger Sub UpdateRecord(byval sender as system.object, byval e as system.eventargs) ... End Sub
I need to capture my previous record from Sub EditRec and compare them
in Sub UpdateRecord.
Any idea on how it works? Thanks in advanced.
rgds, Phoebe.
"Carno C. Mercado" <on***@webgate.net.ph> wrote in message news:O$**************@tk2msftngp13.phx.gbl... Public Class Form1 Private sTr as String Private i as Integer . .
' Constructor Public Sub New() sTr = "Test"
End Sub
Public Sub Method1
' here you can see the value of sTr if ( sTr = "Test ) then
end if
end sub
More Functions
End Class
"Phoebe." <ph********@hotmail.com> wrote in message news:u7**************@TK2MSFTNGP11.phx.gbl... > Hi, Good Day! > > I need to create a variable that it's value can be carry across
within a > form. > > I've created some above the "web form designer generated code" but
it seems > not working. > > It reset back to nothing when i click on a button. > > Can someone help? > Thanks in advanced. > > rgds, > Phoebe > >
Hi Phoebe
Have a look at "Session" variables and to "Viewstate"
I hope this helps
Cor
Yes, and the only way to do that is to know what record was just edited (see
my last post). Once you know what row of the grid was edited, you can use
FindControl to grab the data.
"Phoebe." <ph********@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP12.phx.gbl... Thanks Scott.
But I need the data that pass to UpdateRecord for comparison.
"Scott M." <s-***@BADSPAMsnet.net> wrote in message news:eG**************@TK2MSFTNGP12.phx.gbl... In the DataGrid's EditCommand event handler use the eventArgs argument
to determine what row was edited (e.item?).
"Phoebe." <ph********@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl... Thanks Carno.
My situation is i have a edit in my datagrid and this trigger Sub EditRec(Byval objsrc as object, byval objargs as datagridcommandeventargs) ... End Sub
I have a Update button which trigger Sub UpdateRecord(byval sender as system.object, byval e as system.eventargs) ... End Sub
I need to capture my previous record from Sub EditRec and compare them in Sub UpdateRecord.
Any idea on how it works? Thanks in advanced.
rgds, Phoebe.
"Carno C. Mercado" <on***@webgate.net.ph> wrote in message news:O$**************@tk2msftngp13.phx.gbl... > Public Class Form1 > Private sTr as String > Private i as Integer > . > . > > ' Constructor > Public Sub New() > sTr = "Test" > > End Sub > > Public Sub Method1 > > ' here you can see the value of sTr > if ( sTr = "Test ) then > > end if > > end sub > > More Functions > > > End Class > > > > > "Phoebe." <ph********@hotmail.com> wrote in message > news:u7**************@TK2MSFTNGP11.phx.gbl... > > Hi, Good Day! > > > > I need to create a variable that it's value can be carry across within a > > form. > > > > I've created some above the "web form designer generated code" but it > seems > > not working. > > > > It reset back to nothing when i click on a button. > > > > Can someone help? > > Thanks in advanced. > > > > rgds, > > Phoebe > > > > > >
Thanks again, Scott.
"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:#5**************@TK2MSFTNGP10.phx.gbl... Yes, and the only way to do that is to know what record was just edited
(see my last post). Once you know what row of the grid was edited, you can use FindControl to grab the data.
"Phoebe." <ph********@hotmail.com> wrote in message news:ev**************@TK2MSFTNGP12.phx.gbl... Thanks Scott.
But I need the data that pass to UpdateRecord for comparison.
"Scott M." <s-***@BADSPAMsnet.net> wrote in message news:eG**************@TK2MSFTNGP12.phx.gbl... In the DataGrid's EditCommand event handler use the eventArgs argument to determine what row was edited (e.item?).
"Phoebe." <ph********@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl... > Thanks Carno. > > My situation is i have a edit in my datagrid and this trigger > Sub EditRec(Byval objsrc as object, byval objargs as > datagridcommandeventargs) > ... > End Sub > > I have a Update button which trigger > Sub UpdateRecord(byval sender as system.object, byval e as system.eventargs) > ... > End Sub > > I need to capture my previous record from Sub EditRec and compare
them in > Sub UpdateRecord. > > Any idea on how it works? > Thanks in advanced. > > rgds, > Phoebe. > > "Carno C. Mercado" <on***@webgate.net.ph> wrote in message > news:O$**************@tk2msftngp13.phx.gbl... > > Public Class Form1 > > Private sTr as String > > Private i as Integer > > . > > . > > > > ' Constructor > > Public Sub New() > > sTr = "Test" > > > > End Sub > > > > Public Sub Method1 > > > > ' here you can see the value of sTr > > if ( sTr = "Test ) then > > > > end if > > > > end sub > > > > More Functions > > > > > > End Class > > > > > > > > > > "Phoebe." <ph********@hotmail.com> wrote in message > > news:u7**************@TK2MSFTNGP11.phx.gbl... > > > Hi, Good Day! > > > > > > I need to create a variable that it's value can be carry across within a > > > form. > > > > > > I've created some above the "web form designer generated code"
but it > > seems > > > not working. > > > > > > It reset back to nothing when i click on a button. > > > > > > Can someone help? > > > Thanks in advanced. > > > > > > rgds, > > > Phoebe > > > > > > > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: David Hitillambeau |
last post by:
Hi guys,
As I am new to Python, i was wondering how to declare and use global
variables. Suppose i have the following structure in the same module (same
file):
def foo:
<instructions>...
|
by: Andrew V. Romero |
last post by:
I have been working on a function which makes it easier for me to pull
variables from the URL. So far I have:
<script language="JavaScript">
var variablesInUrl;
var vArray = new Array();
...
|
by: Dan Elliott |
last post by:
Hello,
Converting from a working C program to C++, I run into the following error:
I have a header: (header.h)
namespace shared{
...
struct X{
...
|
by: Thomas Matthews |
last post by:
Hi,
I'm getting linking errors when I declare a variable in the
global scope, but not inside a function. The declarations
are the same (only the names have been changed...).
class Book
{...
|
by: lawrence |
last post by:
I'm learning Javascript. I downloaded a script for study. Please tell
me how the variable "loop" can have scope in the first function when
it is altered in the second function? It is not defined...
|
by: MLH |
last post by:
A97 Topic: If there is a way to preserve the values assigned to
global variables when an untrapped runtime error occurs? I don't
think there is, but I thought I'd ask.
During development, I'm...
|
by: Charles O'Flynn |
last post by:
As a complete newcomer (2-3 days) to PHP, although not to programming in
general, I have 'dived in' to start a small project to read and parse an XML
data stream. I have already worked out most of...
|
by: Ed Jensen |
last post by:
I'm having a vexing problem with global variables in Python. Please
consider the following Python code:
#! /usr/bin/env python
def tiny():
bar =
for tmp in foo:
bar.append(tmp)
foo = bar
|
by: weaknessforcats |
last post by:
C++: The Case Against Global Variables
Summary
This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
|
by: istillshine |
last post by:
When I control if I print messages, I usually use a global variable
"int silent". When I set "-silent" flag in my command line
parameters, I set silent = 1 in my main.c.
I have many functions...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |