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

Break in ASP Pages

nitindel
Hi frends,

I am working on ASP,VBSCRIPT,JAVASCRIPT...

Suppose if i have an condition in the script and if the condtion fails then i want to break the flow and raise the error .....i mean the below code should not be executed and the page should remain the same.

Response.end will stop rendering the below page.

See the below snippet..


Expand|Select|Wrap|Line Numbers
  1. dim arrSelect(1) 
  2. arrSelect(0) = "empid"
  3. dim dbconnCheck
  4. set dbconnCheck=server.CreateObject("dbcom.dbhandler")
  5. dbconnCheck.connect
  6. dbconnCheck.FormSQLStmt "emp",4,arrSelect,,"where empid='"&Request.Form("employeeid")&"'"
  7. dbconnCheck.ExecuteSql 
  8. set empidot = Server.CreateObject("Adodb.RecordSet")
  9. set empidot = dbconnCheck.GetRecordset
  10. if empidot.RecordCount > 0 then 
  11. Response.Write("<script>alert('No record found')</script>")

Thanks in Advance
Nitin Sharma
Software Engineer
Jan 3 '08 #1
7 1383
Hi ...friends...
please tell...
if a am having a piece of code that checks in the recordset that do not have more than one value..?? if it does have more than one value i.e rs.recordcount > 0 the it should throw an alert

in the form of like below:

Expand|Select|Wrap|Line Numbers
  1. Response.write("<script> alert('Record already Exists')</script>")
  2. txtempid.focus
  3.  
but in the same page the code exists..the alert should not hamper the rest of code.

thnaks in Advance ..please tell asap

Nitin Sharma
Software Engineer
Jan 3 '08 #2
acoder
16,027 Expert Mod 8TB
This should be coded in your ASP page. Why have you posted this in JavaScript?
Jan 3 '08 #3
I have posted on both ASP and Javascript forums....but no reply till yet from any of them..!!

Thanks & Regards
Nitin Sharma
Jan 4 '08 #4
acoder
16,027 Expert Mod 8TB
You have got replies, but not a solution yet.

This is really an ASP problem. JavaScript is client-side, but the server-side code whether it be ASP or another language can generate code to display. You'll just need an if statement to check the condition and display the JavaScript.

If you've got a problem in the JavaScript, post the code here.
Jan 4 '08 #5
Thanks to all those who have replied..!!!


I got the solution as I have used Server.Execute...instead response.end and all that stuff...so i thinks its a better way of doing...
my module is completed henceforth ..
Thanks to u all once again...

Nitin Sharma
Software Engineer
Jan 14 '08 #6
acoder
16,027 Expert Mod 8TB
Glad you got it working though I wasn't able to help and thanks for letting us know.
Jan 14 '08 #7
Glad you got it working though I wasn't able to help and thanks for letting us know.
Thanks a lot.................!!! :-)
Jan 15 '08 #8

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

Similar topics

6
by: Sandman | last post by:
Ok, so I have PHP set upp to ato_prepend and auto_append files to every script I run. So if I someone surfs to /index.php, these scripts run: init.php -> set up DB connections and...
1
by: Scanner2001 | last post by:
I am trying to insert a printer page break inside of a form. I do not seem to be able to do this. My form contains 3 asp panels. Each of the panels have dynamically built content, and they are...
3
by: Jennie | last post by:
I am looking for a way to make the web page have a formfeed so the info from that spot will go to the top of the next printed page when I file>print the web page. I want it not to break on the...
18
by: Gustaf Liljegren | last post by:
IE does, and I can't remember this used to be a problem in Netscape. I guess someone in the Mozilla team just came up with a Smart Idea about the True Semantics of the Hyphen Minus character. :-(...
8
by: Danny | last post by:
I've read the recent post about not breaking at hyphens in HTML documents. I *want* breaking to occur at hyphens. (for 'hyphen' read 'minus sign') IE6 and Opera7.54 both break phrases such as...
1
by: pemigh | last post by:
I have a report with pages breaking in the middle of text box controls. And it's not just on a line-by-line basis, but sometimes (in a situation that I can no longer recreate) just the bottom...
26
by: Chris Potter | last post by:
Hello everyone. I am taking my first course in C and in one of my assignments i need to print out an array that could have anywhere from 0 to 100 positive integers in it (a negative integer is...
6
by: Joseph Geretz | last post by:
I recently upgraded my server to Windows 2003. The first thing I noticed is that my sample WebService pages no longer worked. The Invoke test button is missing. This is addresed by the following KB...
8
by: CJM | last post by:
What is the best way to force a page break when printing from a browser? A page in my application generates a series of tables which are usually less than will fit on a page of A4. Ideally I want...
7
by: =?Utf-8?B?aXdlYg==?= | last post by:
Can we set page breaks in ASP Pages dynamically based on the data being populated? Akshay.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.