473,395 Members | 1,774 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,395 software developers and data experts.

Response.Direct depending on database value

4
I want to have simple aspx page which reads a database record, selecting it according to parameter received (ie request.querystring).

I then want it to check a field on the database record and redirect to one of four pages depending on whether the value of the field is 1, 2, or 4

eg if 1 response.redirect("page1.aspx")
if 2 response.redirect("page2.aspx") etc

I need to do this without any intervention from the user ie not using any button on the page.

I've tried various methods using code behind page but not getting anywhere.

Can anyone help?
Sep 15 '08 #1
2 1341
DrBunchman
979 Expert 512MB
Use a Case statement. e.g.

Expand|Select|Wrap|Line Numbers
  1. Select Case RecordSetObject("fieldname")
  2.     Case 1
  3.         response.redirect("page1.aspx")
  4.     Case 2
  5.         response.redirect("page2.aspx")
  6.     Case 3
  7.         response.redirect("page3.aspx")
  8. End Select
By the way, you've posted your question in the ASP Forum which is for Classic ASP only - I've moved it for you but in future please post all ASP.NET questions in the .NET Forum.

Hope this helps,

Dr B
Sep 16 '08 #2
beish1
4
Many thanks Dr B - the simplest methods are always the best!
Sep 16 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: TinyTim | last post by:
I'm a newbie at ASP & HTML. It seems that when you use server side code and you're going to return a customized HTML form with several fields and labels, you have to do an extensive amount of...
8
by: Jack | last post by:
Hi, Here is my problem: I am logging in to a page, where the page retrieves a record from a database. The text boxes are used in the display formto let the users update the fields, if they...
9
by: WalterR | last post by:
This is my first time here, so there may be earlier relevant threads of which I am unaware. Though my experience with DB2 is not extensive, such as it is was under OS/390 or equ. My main...
0
by: Peer K | last post by:
Hello, This is driving me nuts! It's a bit hard to explain so please bare with me. I have an ASP.NET page that uses the calendar control. I use DayRender to set specific days selectable...
8
by: Ariel Erlijman | last post by:
I have a .htm with this script in the body <SCRIPT src="\TestScriptNET\test.aspx" LANGUAGE="JavaScript" TYPE="text/javascript"></SCRIPT> And in my test.aspx Page_Load the following code: ...
2
by: Glen Wilkin via DotNetMonster.com | last post by:
Is there a way I can call Response.Redirect after I've done a Response.Flush? I send some html to load an animated gif that plays whilst my page loads, it has some extensive database calls to...
7
by: eventuranza | last post by:
For my application, there users can upload and download files to the a webserver. Straightforward enough. However, when they upload a PDF file then try to download it, the file seems to be...
11
by: Paul Furman | last post by:
I'm setting up credit card payment through authorize.net and they have the option to send a POST string back to my site once complete. I'm not sure how to proceed. They don't have much to read...
5
by: BURL ives | last post by:
I am well versed in MS Access. I now want to set up a SQL database on my company's server. However there are some pretty basic questions that I have starting out...I did a bit of searching but...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.