Solved

How to execute server code in VB.NET on a button click and then call up another page

Posted on 2011-02-20
6
554 Views
Last Modified: 2012-05-11
I do realize that this is a dumb question, but I am new to ASP.NET, so this should be really easy.

I have an aspx page with a form on it that the user fills out. When they click my Submit button, which is a button called buttonSubmit, but I don't think it is THE submit button. Anyway, this submit button has VB code behind it that saves the data from the form to a database, sends out a confirmation email to the user and another email to us that one was added, and then I simply want it to bring up a different page, a ThankYou page. I just don't have any idea how to tell the server to send back a different page than the one that processed the button.

Please help!
0
Comment
Question by:jkurant
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 4

Expert Comment

by:LAMASE
ID: 34938843
AJAX is the way. The button calls the code with http (you need to check the permissions and inputs) and then in js you can do what you want.
For the ajax code, it depends on your website... if no js framework are installed, i suggest jQuery, with his ajax method.
0
 

Author Comment

by:jkurant
ID: 34938859
LAMASE,

How do I get it to execute the code on the server to insert in the database and send emails from javascript before I set location.href = whatever?
0
 

Author Comment

by:jkurant
ID: 34938880
my button runs VB code on the server and then it brings back the same page. I want it to go to another page. Isn't this the simplest thing to do? Or do I need to pass back the url i want to go to in a field or something and then have javascript pull that page once the old page comes back, but that sounds like an awful lot of work to do something very simple.

0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 4

Expert Comment

by:LAMASE
ID: 34938943
Sorry, I didn't understand in the first post:
Since this is a VB question, I cannot helo you more, sorry, I'm not expert in VB.
0
 

Accepted Solution

by:
jkurant earned 0 total points
ID: 34938950
Response.redirect
0
 

Author Closing Comment

by:jkurant
ID: 34978060
I had to figure this out myself. I thought it was a super easy question for anyone who develops in ASP.NET, but no one answered the question.
0

Featured Post

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question