I need to do something on a page with a datagrid in the case where the
page is loaded but the Update button is *not* clicked.
Specifically, I am adding a blank row to the dataset with an external
Add button. The dataset is strongly typed, so I can't add a blank
value to the primary key. I put a "Temp" string in this field so the
user can add a new value when the page is loaded with that row set as
editable. If the user doesn'
t click update, I want to reload the dataset from the dataadapter and
bind to the datagrid, thus removing the temporary row that has not
been filled out.
Is there a way, short of a kludge like using session variables in
every other event, that I can test for this using the EventArgs object
passed to Page_Load?
Thanks 3 1089
if(!IsPostBack( ))
{
no click here
}
else
{
somethign posted back
}
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"John Hoge" <jh******@yahoo .com> wrote in message
news:d0******** *************** **@posting.goog le.com... I need to do something on a page with a datagrid in the case where the page is loaded but the Update button is *not* clicked.
Specifically, I am adding a blank row to the dataset with an external Add button. The dataset is strongly typed, so I can't add a blank value to the primary key. I put a "Temp" string in this field so the user can add a new value when the page is loaded with that row set as editable. If the user doesn' t click update, I want to reload the dataset from the dataadapter and bind to the datagrid, thus removing the temporary row that has not been filled out.
Is there a way, short of a kludge like using session variables in every other event, that I can test for this using the EventArgs object passed to Page_Load?
Thanks
"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message news:<ul******* *******@tk2msft ngp13.phx.gbl>. .. if(!IsPostBack( )) { no click here } else { somethign posted back }
It's not quite *that* easy! I want to refresh the dataset if the even
triggering the page load is anything but an update. It could be a
postback for some other reason.
Is there a way to see, in the Page_Load method, the specific control
that triggered the postback. In other words,
private void Page_Load(objec t o, EventArgs e){
if (**Event calling this page is not the update button from
datagrid1**)
{
UpdateDataSet() ;
}
}
I have several controls on this page, and I want to make sure that the
dataset is refreshed in all circumstances, except when the user has
just clicked update.
Thanks.
You can add a little javascript on the onclick handler of the update
button to change the value of a hidden field on the page and you can
check *that* in page load.
I just did a whole navigation system that relies on this method.
Many of us wish we could get the postback args in page load.
Sometimes I think that if a couple of us got in a room together for
three hours we could design something better than Microsoft.
-Sam
PS Could you check the __EVENT_TARGET in the forms collection to see
if it looked like your update buttons? Just a thought. jh******@yahoo. com (John Hoge) wrote in message news:<d0******* *************** ****@posting.go ogle.com>... "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message news:<ul******* *******@tk2msft ngp13.phx.gbl>. .. if(!IsPostBack( )) { no click here } else { somethign posted back }
It's not quite *that* easy! I want to refresh the dataset if the even triggering the page load is anything but an update. It could be a postback for some other reason.
Is there a way to see, in the Page_Load method, the specific control that triggered the postback. In other words,
private void Page_Load(objec t o, EventArgs e){ if (**Event calling this page is not the update button from datagrid1**) { UpdateDataSet() ; } }
I have several controls on this page, and I want to make sure that the dataset is refreshed in all circumstances, except when the user has just clicked update.
Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Raymond Arthur St. Marie II of III |
last post by:
very Very VERY dumb ? about the new Set( ) 's
Please be kind and read this like you know I've been up 33-34 hours reading
PEP's but...
Doc\ref 2.6 Delimiters show's three unused characters "@ $ ?".
@ sort of looks like and sort of sounds like a set an
$ well sort of obvious.
I can imagine that the $ would be confused for money and @ is ugly.
|
by: shanx__=|;- |
last post by:
hi i need some help regarding use of very very long integer datatype
in 'c'.. i need it to store result of large number's factorial..
if someone can healp it would be a delight..
|
by: Robert Hooker |
last post by:
Hi,
I'm curious to know if I'm doing something wrong here, or if this is just
mind-numbingly slow for a reason.
In a simple WindowsFormsApplication:
public Form1()
{
// Required for Windows Form Designer support
|
by: Brad |
last post by:
I am very very new to ASP .Net developement and am all self-taught. I have
been programming Windows vb forms for a while however. I know this is a
stupid question. I have my home page and some other pages. But once a user
logs in and the password validated, how do I redirect to another page?
Thanks for the help.
|
by: Ghislain Tanguay |
last post by:
I have a compiled vb.net app and I want to give the user a choice to launch
it from the start line command and pass it a parameter or not. How can I do
that in my code? Is it possible?
Ex. : MyApp.exe "Go"
| |
by: Jeff Calico |
last post by:
Hi
I have what I think is a easy question about how to pull cross
reference data
when I transform my XML file. I can't seem to find a good example of
how to do
this on the web, though.
Here is the XML file I am supposed to process:
|
by: aghazalp |
last post by:
hi guys,
this would be the most basic question ever...I am not a programmer but
I am trying to learn programming in python...I was reading John Zelle's
text book and instructed me to make .py file and save it on the desk
top...then it said close the python GUI and double click on the icon of
the I just made and that should run the program...well, the good news
is that it does but when I input a number for calculation and press the
enter...
|
by: John |
last post by:
Is there any special code I have to write to log event to Security
Event Log? The following code give me "Very Easy Question, How to
write log to SECURTY Event Log? Please help" Error
// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog();
myLog.Source = "Security";
// Write an informational entry to the event log.
myLog.WriteEntry("Writing warning to event log.",
|
by: robert.b.walden |
last post by:
Hello,
Easy question from a newbie. I have text boxes which collect users
input and on the click of a button do some calculations and output to
another text box. I need to easily convert the numbers inputted to
int's so I can do the calculations. Also I need to figure out how to
pop up an error box if the charactors entered in those boxes are
anything but numbers. Thanks in advance for helping someone trying to
learn this robust...
|
by: SteveM |
last post by:
I am sure this is an easy question, but being relatively new to ASP.NET
programming, I can not quite grasp what I need to accomplish what I
need to do.
What I have is a word document that is rendered as a page (or actualy a
part of a page) that is editiable. To do this I let the user download
the document, edit it and then upload it back to the site. Then at
Page_Open, I convert the .doc file to an html and render it back to the
page......
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |