473,831 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Very, very, easy question

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
Nov 18 '05 #1
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

Nov 18 '05 #2
"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.
Nov 18 '05 #3
Sam
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.

Nov 18 '05 #4

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

Similar topics

4
1716
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.
19
7285
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..
2
8278
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
5
271
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.
13
1485
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"
3
1216
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:
6
1247
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...
8
6616
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.",
4
1916
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...
7
2455
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......
0
9642
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,...
0
10494
jinu1996
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...
0
10207
tracyyun
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...
0
9317
agi2029
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...
1
7748
isladogs
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...
0
5619
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...
0
5780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4416
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
2
3963
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.