Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Exit server side script on ASP page

Posted on 2006-07-12
5
Medium Priority
?
198 Views
Last Modified: 2008-03-06
I need to validate that there are records returned.  If not I need to exit the sever side script and display an alert box on the aspx.net page.   How can I do this please.  I do not want to use response.write I need the user to be alerted to the fact that there is no info for them.

Thanks

If objRdr.Read() Then
       Response.Write(objRdr(0))
    Else
       response.Write("NO RECORDS RETURNED")
    End If  
0
Comment
Question by:running32
[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
  • 3
  • 2
5 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17092244
Try:

    If objRdr.Read() Then
       Response.Write(objRdr(0))
       Response.Write("<script language=""javascript"">alert('NO RECORDS RETURNED');</script>"
       Response.Flush()
    Else
       response.Write("NO RECORDS RETURNED")
    End If  
0
 

Author Comment

by:running32
ID: 17092379
Nope that's not it.  The page give the error no End if.  
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17093388
Does it say where ? It shouldn't be for that block.
0
 

Author Comment

by:running32
ID: 17094591
If I take out the Response.Write("<script language=""javascript"">alert('NO RECORDS RETURNED');</script>" the page is ok again.

Thanks
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 17094618
Oh, its missing the closing bracket:

     Response.Write("<script language=""javascript"">alert('NO RECORDS RETURNED');</script>")
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

670 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