Connecting Tech Pros Worldwide Help | Site Map

Break in ASP pages.

nitindel's Avatar
Member
 
Join Date: Dec 2007
Posts: 67
#1: Dec 31 '07
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
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,690
#2: Jan 3 '08

re: Break in ASP pages.


have you considered putting this code within a conditional if statement?

Jared
nitindel's Avatar
Member
 
Join Date: Dec 2007
Posts: 67
#3: Jan 3 '08

re: Break in ASP pages.


Quote:

Originally Posted by jhardman

have you considered putting this code within a conditional if statement?

Jared


Yes ..!!

If condition is there
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,690
#4: Jan 3 '08

re: Break in ASP pages.


Quote:

Originally Posted by nitindel

Yes ..!!

If condition is there

so... what's the problem?

Jared
nitindel's Avatar
Member
 
Join Date: Dec 2007
Posts: 67
#5: Jan 3 '08

re: Break in ASP pages.


Quote:

Originally Posted by jhardman

so... what's the problem?

Jared

Done...

Thanks..!!
Reply


Similar ASP / Active Server Pages bytes