Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 5th, 2012, 02:29 PM
Authorized User
Points: 56, Level: 1
Points: 56, Level: 1 Points: 56, Level: 1 Points: 56, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2012
Location: Upstate NY
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 13, Pg 469, error on EndEditing sub

Hi,

I am at Step 16 of the "Try It Out" on page 469, and I am having a problem defining the EndEditing sub. My code is as follows:
Code:
Partial Class Management_AddEditReview
    Inherits System.Web.UI.Page

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Request.QueryString.Get("Id") IsNot Nothing Then
      DetailsView1.DefaultMode = DetailsViewMode.Edit
    End If
  End Sub

  Protected Sub DetailsView1_ItemInserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertedEventArgs) Handles DetailsView1.ItemInserted
    EndEditing()
  End Sub

  Protected Sub DetailsView1_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles DetailsView1.ItemInserting
    e.Values("UpdateDatetime") = DateTime.Now
  End Sub

  Protected Sub DetailsView1_ItemUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdatedEventArgs) Handles DetailsView1.ItemUpdated
    EndEditing()
  End Sub

  Protected Sub DetailsView1_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdateEventArgs) Handles DetailsView1.ItemUpdating
    e.NewValues("UpdateDatetime") = DateTime.Now
  End Sub
End Class

Private Sub EndEditing()
  Response.Redirect("Reviews.aspx")
End Sub
and I am getting the following errors:

1 & 2, EndEditing is not declared (which I would expect)
3, Statement is not valid in a namespace (on Private Sub EndEditing() statement)

Intelisence would not let me type Response.Redirect either, so I know I am missing something, but I don't have a clue what it is.

Any help is appreciated. Thanks! s.
Reply With Quote
  #2 (permalink)  
Old June 5th, 2012, 02:34 PM
Authorized User
Points: 56, Level: 1
Points: 56, Level: 1 Points: 56, Level: 1 Points: 56, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2012
Location: Upstate NY
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Never Mind....

Sorry, shot from the hip. I finally realized the subroutine was outside of the "Class" (I placed the subroutine after the "End Class" statement.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
EndEditing error vbboyd BOOK: Beginning ASP.NET 4 : in C# and VB 1 April 4th, 2012 05:42 PM
Ch 9 p.469 O/R Design Surface behaior problem Pegasus40218 BOOK: Professional ASP.NET 3.5 SP1 Edition: In C# and VB 0 July 8th, 2010 05:55 PM
Help??!! Error when working in Ch. 13 convert21 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 October 9th, 2009 03:39 AM
Ch 2 pg 70: links throw error subgenius BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 4 August 16th, 2004 05:26 PM



All times are GMT -4. The time now is 12:49 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.