I have a datagrid containing a drop-down-list. The datagrid contains
Edit,Update,Can cel buttons and respective events. Whenever I make a change
to one particular field (a drop-down-list in column3), as soon as I click
UPDATE the original value which existed at load-time replaces the value I
chose. Is this a postback problem, and if so how would I resolve this?
Thanks. 5 1458
Hi MrMike,
This probably is a post back problem.
Add a check in the Page Load event like this:
if( !IsPostBack )
{
...call databind etc....
}
HTH,
Rakesh Rajan
"MrMike" wrote: I have a datagrid containing a drop-down-list. The datagrid contains Edit,Update,Can cel buttons and respective events. Whenever I make a change to one particular field (a drop-down-list in column3), as soon as I click UPDATE the original value which existed at load-time replaces the value I chose. Is this a postback problem, and if so how would I resolve this?
Thanks.
Rakesh, If I modify the Page_Load event for "If Is Postback Then..." no data
appears on the form. If I modify the Page_Load for "If Not Is Postback
Then..." then data initially appears on the form but once I click EDIT the
data goes away.
Should the logic go somewhere else, like in the UpdateCommand event or
something? Thanks!
"Rakesh Rajan" wrote: Hi MrMike,
This probably is a post back problem. Add a check in the Page Load event like this: if( !IsPostBack ) { ...call databind etc.... }
HTH, Rakesh Rajan
"MrMike" wrote:
I have a datagrid containing a drop-down-list. The datagrid contains Edit,Update,Can cel buttons and respective events. Whenever I make a change to one particular field (a drop-down-list in column3), as soon as I click UPDATE the original value which existed at load-time replaces the value I chose. Is this a postback problem, and if so how would I resolve this?
Thanks.
Hi MrMike,
Sorry I didn't explain everything earlier.
Bind the datagrid as I said in the check for PostBack.
In the command events, then set the appropriate index properly and then call
DataBind again.
This MSDN walkthrough will help you out http://www.msdn.microsoft.com/librar...dWriteData.asp
Let me know if I could be of more help.
HTH,
Rakesh Rajan
"MrMike" wrote: Rakesh, If I modify the Page_Load event for "If Is Postback Then..." no data appears on the form. If I modify the Page_Load for "If Not Is Postback Then..." then data initially appears on the form but once I click EDIT the data goes away.
Should the logic go somewhere else, like in the UpdateCommand event or something? Thanks!
"Rakesh Rajan" wrote:
Hi MrMike,
This probably is a post back problem. Add a check in the Page Load event like this: if( !IsPostBack ) { ...call databind etc.... }
HTH, Rakesh Rajan
"MrMike" wrote:
I have a datagrid containing a drop-down-list. The datagrid contains Edit,Update,Can cel buttons and respective events. Whenever I make a change to one particular field (a drop-down-list in column3), as soon as I click UPDATE the original value which existed at load-time replaces the value I chose. Is this a postback problem, and if so how would I resolve this?
Thanks.
Thank you very much Rakesh. I'm headed in the right direction now.
"Rakesh Rajan" wrote: Hi MrMike,
Sorry I didn't explain everything earlier.
Bind the datagrid as I said in the check for PostBack.
In the command events, then set the appropriate index properly and then call DataBind again. This MSDN walkthrough will help you out: http://www.msdn.microsoft.com/librar...dWriteData.asp
Let me know if I could be of more help.
HTH, Rakesh Rajan
"MrMike" wrote:
Rakesh, If I modify the Page_Load event for "If Is Postback Then..." no data appears on the form. If I modify the Page_Load for "If Not Is Postback Then..." then data initially appears on the form but once I click EDIT the data goes away.
Should the logic go somewhere else, like in the UpdateCommand event or something? Thanks!
"Rakesh Rajan" wrote:
Hi MrMike,
This probably is a post back problem. Add a check in the Page Load event like this: if( !IsPostBack ) { ...call databind etc.... }
HTH, Rakesh Rajan
"MrMike" wrote:
> I have a datagrid containing a drop-down-list. The datagrid contains > Edit,Update,Can cel buttons and respective events. Whenever I make a change > to one particular field (a drop-down-list in column3), as soon as I click > UPDATE the original value which existed at load-time replaces the value I > chose. Is this a postback problem, and if so how would I resolve this? > > Thanks.
Glad to hear that Mike :)
"MrMike" wrote: Thank you very much Rakesh. I'm headed in the right direction now.
"Rakesh Rajan" wrote:
Hi MrMike,
Sorry I didn't explain everything earlier.
Bind the datagrid as I said in the check for PostBack.
In the command events, then set the appropriate index properly and then call DataBind again. This MSDN walkthrough will help you out: http://www.msdn.microsoft.com/librar...dWriteData.asp
Let me know if I could be of more help.
HTH, Rakesh Rajan
"MrMike" wrote:
Rakesh, If I modify the Page_Load event for "If Is Postback Then..." no data appears on the form. If I modify the Page_Load for "If Not Is Postback Then..." then data initially appears on the form but once I click EDIT the data goes away.
Should the logic go somewhere else, like in the UpdateCommand event or something? Thanks!
"Rakesh Rajan" wrote:
> Hi MrMike, > > This probably is a post back problem. > Add a check in the Page Load event like this: > if( !IsPostBack ) > { > ...call databind etc.... > } > > HTH, > Rakesh Rajan > > "MrMike" wrote: > > > I have a datagrid containing a drop-down-list. The datagrid contains > > Edit,Update,Can cel buttons and respective events. Whenever I make a change > > to one particular field (a drop-down-list in column3), as soon as I click > > UPDATE the original value which existed at load-time replaces the value I > > chose. Is this a postback problem, and if so how would I resolve this? > > > > Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Igor Belagorudsky |
last post by:
Hi,
i am trying to analyze data submitted in a form but the problem is that when
i try to create the controls in code (which is what i want to do), it throws
an obect not found exception on postback when i try to Page.FindControl:
private void Page_Load(object sender, System.EventArgs e)
{
if (Page.IsPostBack)
{
|
by: Xavier Osa |
last post by:
Hi,
I have an ASP.Net web page that you can download a file. As
Fergunson's problem, it prompts twice dialog boxes only if I select
Open button. If I select Save button, it prompts once.
I'm using W2000KS & IE6 sp1 & VS.NET 2003.
If I change method="post" by method="get" form attribute, it works
fine.
|
by: Mad Scientist Jr |
last post by:
I don't know how this is happening, but a dropdown control I have is
resetting to the 2nd value on the list anytime a postback occurs.
I have no initiation code outside of
If Not (IsPostBack)
I have EnableViewState set to true for the control - the control stays
populated, it just is losing its selected value.
The control is not contained in any panels or anything, just a Web
|
by: Krista Lemieux |
last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with
this technology. I've been told that when I have a control, I should
only bind the data to it once, and not on each post back (basically
have the data binding done in the If NOT IsPostBack Then statement).
How come? How does this information get preserved?
Which raises another question. Becuase I want to get away from the
spaghetti code approach, I would like to create...
|
by: RAJ |
last post by:
In our multi-tier application, we have several ASP.NET user controls which
will update the same data source provided by middle tier logic.
In this particular scenario we have one user control displaying the contents
of the data source, whilst another control updates the datasource via a
command buttons implementation of 'Click', an event raised in the 'Handle
Postback Events' stage of the control execution life cycle (via the...
| |
by: |
last post by:
Hi all,
I have a bunch of dropdownlists that are populated in client-side
javascript. When i do a postback I get the following error:-
Invalid postback or callback argument. Event validation is enabled using
<pages enableEventValidation="true"/> in configuration or <%@ Page
EnableEventValidation="true" %> in a page. For security purposes, this
feature verifies that arguments to postback or callback events originate
|
by: Timbo |
last post by:
Hi all,
This is my first message here so i'll try and include all the
information that will help you help me out, if possible.
Basically I am using C# in ASP.NET 2.0 and have a Repeater control in
my aspx page with two image buttons, one for an edit command, another a
delete command. Here is a cut down code fragment.
...
|
by: Jason |
last post by:
I have a webpage that I've wrapped in an Atlas UpdatePanel. This page
contains four textboxes, each with AutoPostBack set to true. The problem
comes when someone edits the first box and tabs to the second box. They have
enough time to make a quick edit to the second box before the postback
completes and then the value in the second textbox is reset to the original
value. Is there anything I can do about this? It's really causing...
|
by: antonyliu2002 |
last post by:
I know that this has been asked and answered thousands of times. As a
matter of fact, I know that I need to say
If Not Page.IsPostBack Then
'Do something
End If
for things that needs to be processed by the web server. I am still
struggling to understand this postback logic, and hope that some kind
gurus out there could help me clarify the confusion I have.
|
by: mc |
last post by:
I'm writing an app for managing Task Lists, I'm trying to add some
controls to a form that I can use to link tasks, my original intention
was to: -
Add two list boxes, one listing "all Tasks" and the other listing
"Linked Tasks", I have two buttons which in javascript move items from
the first list into the second.
Then when a user clicks a thrid button I would like to save this data.
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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: 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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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: 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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |