How do I redirect to a new web page using the AfterSave event.


Author
Message
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
I'm using asp.net web forms and would like to redirect a user whenever the data they entered successfully saves to the database. I was wondering how to do this using the AfterSave event. Or maybe there's a better way to do it??

Thanks! Smile 
StrataFrame Team
S
StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Most likely, you'll be saving your data during a postback on the OnLoad method.  Saving is a quick operation, so I would just save like normal, check the SaveResult enum value returned from the Save(), and call Response.Redirect() if the save successful.  I don't think you'll have to use the AfterSave event to do it.
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Thank you so much for your help!

How do I check the SaveResult enum value that gets returned by the Save()?
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)Advanced StrataFrame User (593 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
I figured it out.

Thank you!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search