473,396 Members | 2,011 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,396 software developers and data experts.

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 1074
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.google.co m...
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_darkfalz.com> wrote in message news:<ul**************@tk2msftngp13.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(object 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.google. com>...
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message news:<ul**************@tk2msftngp13.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(object 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
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 "@...
19
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
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...
5
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...
13
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. :...
3
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...
6
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...
8
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...
4
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...
7
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
marktang
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,...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.