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

Update Before Redirecting

Please help a newbie.

Newbie using VS2005 and ASPX.

I have page1.aspx and page2.aspx. Page2 is using FormView and in the
EditItem Template, I want people to be redirected to page1.aspx after they
have updated the data to the DB.

In the UpdateButton_Click, I used the simple Response.Redirect
("page1.aspx"). The problem is that the UpdateButton_Click takes priority so
it just redirects me to page1.aspx withouth updating the DB. How do I get it
to update the DB first and then redirect me to page1.aspx?

I created a simple test example and I have the code here:
http://pastebin.com/755938

Thanks in advance.

Phil
Jul 24 '06 #1
3 1458
Hello Phillip,

Add an event handler to the FormView control to handle the ItemUpdated
event. This event fires after the update command has been executed on the
data source. In the event handler redirect to the page1.aspx:

protected void FormView1_ItemUpdated(object sender, FormViewUpdatedEventArgs
e)
{
Response.Redirect("Page1.aspx");
}

--
enjoy - brians
http://www.limbertech.com
"Phillip Vong" wrote:
Please help a newbie.

Newbie using VS2005 and ASPX.

I have page1.aspx and page2.aspx. Page2 is using FormView and in the
EditItem Template, I want people to be redirected to page1.aspx after they
have updated the data to the DB.

In the UpdateButton_Click, I used the simple Response.Redirect
("page1.aspx"). The problem is that the UpdateButton_Click takes priority so
it just redirects me to page1.aspx withouth updating the DB. How do I get it
to update the DB first and then redirect me to page1.aspx?

I created a simple test example and I have the code here:
http://pastebin.com/755938

Thanks in advance.

Phil
Jul 25 '06 #2
Brians - Thanks so much. That was perfect and it really helps me in
learning. Can you do me the favor and answer my other question right above
this one?

Thanks again!

Phil
"brians[MCSD]" <br********@discussions.microsoft.comwrote in message
news:E2**********************************@microsof t.com...
Hello Phillip,

Add an event handler to the FormView control to handle the ItemUpdated
event. This event fires after the update command has been executed on the
data source. In the event handler redirect to the page1.aspx:

protected void FormView1_ItemUpdated(object sender,
FormViewUpdatedEventArgs
e)
{
Response.Redirect("Page1.aspx");
}

--
enjoy - brians
http://www.limbertech.com
"Phillip Vong" wrote:
>Please help a newbie.

Newbie using VS2005 and ASPX.

I have page1.aspx and page2.aspx. Page2 is using FormView and in the
EditItem Template, I want people to be redirected to page1.aspx after
they
have updated the data to the DB.

In the UpdateButton_Click, I used the simple Response.Redirect
("page1.aspx"). The problem is that the UpdateButton_Click takes priority
so
it just redirects me to page1.aspx withouth updating the DB. How do I get
it
to update the DB first and then redirect me to page1.aspx?

I created a simple test example and I have the code here:
http://pastebin.com/755938

Thanks in advance.

Phil

Jul 25 '06 #3
I found that this didn't work unless I also added a clause like
"handles FormView1.itemUpdated" in the Sub declaration

ie.
protected void FormView1_ItemUpdated(object sender,
FormViewUpdatedEventArgs
e) Handles FormView1.ItemUpdated
I'm not sure why this was required since many of the code samples I've
looked at don't have it.

-- Ned

Phillip Vong wrote:
Brians - Thanks so much. That was perfect and it really helps me in
learning. Can you do me the favor and answer my other question right above
this one?

Thanks again!

Phil
"brians[MCSD]" <br********@discussions.microsoft.comwrote in message
news:E2**********************************@microsof t.com...
Hello Phillip,

Add an event handler to the FormView control to handle the ItemUpdated
event. This event fires after the update command has been executed on the
data source. In the event handler redirect to the page1.aspx:

protected void FormView1_ItemUpdated(object sender,
FormViewUpdatedEventArgs
e)
{
Response.Redirect("Page1.aspx");
}

--
enjoy - brians
http://www.limbertech.com
"Phillip Vong" wrote:
Please help a newbie.

Newbie using VS2005 and ASPX.

I have page1.aspx and page2.aspx. Page2 is using FormView and in the
EditItem Template, I want people to be redirected to page1.aspx after
they
have updated the data to the DB.

In the UpdateButton_Click, I used the simple Response.Redirect
("page1.aspx"). The problem is that the UpdateButton_Click takes priority
so
it just redirects me to page1.aspx withouth updating the DB. How do I get
it
to update the DB first and then redirect me to page1.aspx?

I created a simple test example and I have the code here:
http://pastebin.com/755938

Thanks in advance.

Phil
Aug 3 '06 #4

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

Similar topics

4
by: Ivo Woltring | last post by:
Hi Pythoneers, I am trying to make my own gui for mencoder.exe (windows port of the terrific linux mencoder/mplayer) to convert divx to Pocket_PC size. My current app creates a batch script to...
1
by: mstjean | last post by:
Beginning to look at the mechanics of deployment at our site for our new project, our first in .NET. Management insists all apps will run from the network, not from desktops and we've managed to...
4
by: Roy Adams | last post by:
Hi posting again because no answer to previous.. tring to loop through a recordset and update a record, thing is it only updates the first record in the table rather than searching through the...
10
by: Kenneth Keeley | last post by:
Hi, I have been having problems with Gecko based browsers not redirecting properly. This is the line of code that does the redirecting: Response.Redirect ("Validation.asp?BookingNo=1234567") ...
3
by: lozd | last post by:
Would appreciate any solutions people could offer for this. Basically I wan't to use a frameset with an aspx page as the contents rather than a htm page and I'd like to be able to redirect the...
4
by: Greg Smalter | last post by:
Redirecting from page to page within a web project is pretty easy. However, all Redirect methods take strings as arguments, as if you mistype the string, you don't find out until run time that you...
8
by: Morpheus | last post by:
I am trying to test a function that outputs text to the standard output, presumably using a cout call. I do not have access to the source, but need to test the output. Is this possible? I can...
0
by: Mangler | last post by:
I have a form that does multiple updates on the page. For some reason that I cant figure out it is redirecting before the update is done. It doesnt do this on another page that I have. <% If...
17
by: mansb2002 | last post by:
Hi, We recently moved our webserver from Win2K to Win2003. The application works fine. Only problem is that when user views a report as a PDF, IE does not show it. The following code is used to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
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,...
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
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
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.