Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 11th, 2014, 07:08 PM
Authorized User
 
Join Date: Aug 2011
Posts: 44
Thanks: 14
Thanked 0 Times in 0 Posts
Default Pages 489-490 - AddEditReview.aspx

Hello Imar,

in the AddEditReview.aspx, if the insert / update operation is successful, the user is redirect straight away to Reviews.aspx.

I would like to inform the user that the insert /update operation was successful.

How could I do that ?
A client side alert as soon as the Review.aspx page is loaded is a viable solution ?
Are there other options ?

Thank you
 
Old January 12th, 2014, 12:51 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Antonius,

Take a look at RegisterStartupScript: http://msdn.microsoft.com/en-us/libr...vs.110%29.aspx

You could call that method when there's some value (like the ID of the new review) in the query string (which you'll need to pass to Reviews.aspx from AddEditReview.aspx).

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Antonius Block (January 12th, 2014)
 
Old January 13th, 2014, 05:34 PM
Authorized User
 
Join Date: Aug 2011
Posts: 44
Thanks: 14
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post

You could call that method when there's some value (like the ID of the new review) in the query string (which you'll need to pass to Reviews.aspx from AddEditReview.aspx).
The problem is that I don't know how to pass the Title of the inserted / updated review to Reviews.aspx in the EndEditing() method (page 489).
I tried many solutions. For instance:

Code:
private void EndEditing()
{
      Response.Redirect("Reviews.aspx?Title=" + "<%# Bind('Title') %>"); 
}
and

Code:
private void EndEditing()
{
      Response.Redirect( String.Format("Reviews.aspx?Title={0};", Eval("Title") ));
}

How can I retrieve the title of the inserted / updated review from the code behind file ?

Thank you
 
Old January 13th, 2014, 05:50 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You'll need to dig into e.Values / e.NewValues of the various event handlers that call the EndEditing method as they contain the data.

This gets a lot easier when hand coding the data access; Chapter 15, exercise 2 shows how to do this.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Antonius Block (January 13th, 2014)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed for Modification to AddEditReview.aspx blueberret BOOK: Beginning ASP.NET 4 : in C# and VB 1 December 30th, 2011 06:49 AM
Chapter 12 AddEditReview.aspx dgjim BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 April 23rd, 2010 12:01 PM
can I ovveride aspx pages? shenku ASP.NET 1.x and 2.0 Application Design 1 June 6th, 2005 07:04 AM
how to get into the Events of aspx pages kashif ASP.NET 1.0 and 1.1 Basics 1 July 29th, 2003 03:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.