Try/catch Function
Does ASP has try/catch function?
For example, if the user accidentaly insert a duplicate data and an error page will exists. so with 'try/catch' function, it display a proper page.
Does ASP has try/catch function?
For example, if the user accidentaly insert a duplicate data and an error page will exists. so with 'try/catch' function, it display a proper page.
I claimed two different urls which both direct to the same websitefolder:
www.one.com
www.two.com
When a user types in the one or the other url they will end up in the default.asp of the same website.
When I would be able to retrieve the url which a user has typed in the browser, I would be able to put it in a nice little variabele to redirect the user to a different page using a nifty little if/else
The problem is that I don't know how to catch the url that the user has typed in .
I have 2 drop down lists here. Supposingly, upon the selection of the 2nd drop down list, I should be able to see textbox entry allowing user to update data being displayed at the bottom. But in my case here, i see no response upon the selection of "selType" which is my second drop down list.
But both also don't work. So any suggestion on how can I retrieve the 2nd drop down list' selected value
i want to catch a redirect on my asp page seems easy.actually i want to redirect a visitor from on page to another page internally and want to catch the referrer of the last page from which the redirect came not the page from where the request has been gerated used meta refresh for no use and response redirect is also not giving the desired results.
View Replies View RelatedI've started implementing my ASP pages (in JScript) using the Try/Catch error handling.
Mostly it is working very well. It gives a nice custom error page which looks somewhat more professional than the default.
However there seems to be one limitation, the error object thrown to the catch statement doesn't include the line that the error occured on. Is there any way to obtain this information?
How does one accurately catch NULL or blank fields in ASP....it appears this
If statement does not appear to be able to catch it...why is this...I appear
to have covered all the necessary conditions but it does not seem able to
pick it up:
If IsNull(Owner_ID) or Owner_ID="" or IsEmpty(Owner_ID) or Owner_ID = Null
Then
Response.Write "A null value has been picked up in the Owner_ID field"
End If
Is there any way in ASP to catch a destroyed session when the user closes their window.
Example.
When a user enters a page, I create a session - Session("blah")="blah" . However when the window is closed, the session is destroyed, but before it's being destroyed, I want to some things.
Alright, I have some person going to my site and submitting the same form over and over and over and over and over. It's a simple to question form that I have at the bottom of all of my parts pages.
They keep submitting it with some very odd stuff.. like
wb32 & GETCONNECTIONCAPABILITIES
TIMEZONEVALUE & atimpab
Outros & mdmsier
I have a ton of things like that.
The form simply sendmails me the info, but still, I'm not diggin.
Does anyone have any ideas of what info I might could collect when someone visits that page(s) and when they submit the form? I would personally like to find out WHO it is.. as I feel it is one of my nasty competitors. Anay ideas?
I have 404.asp file that catches non existing pages such as www.site.com/es for spanish version of site. Now I would like to move ahead and have es.site.com instead. I started digging into subdomains in IIS and found out that usually when creating subdomain in IIS it creates a separate sub-directory by the same name as the subdomain created. From some reason the custom error 404.asp file I already have is not called when a call to a non existing sub domain page is made.
Anyone knows why?
How do I configure 404.asp to also handle subdomain page requests?
I know that in Unix/Apache I can use .htaccess file to direct calls to es.site.com to www.site.com/es quite easily, can this be done somehow on IIS?
What's the difference between private and public functions in ASP? When should I use either?
I am using a simple guestbook /portal and i want script to send mail to the thread owner when someone reply his message.
this is the send message code ....
Can I define a function inside a function. e.g;
function abc()
function xyz()
....some code.....
End Function
End Function
I googled this but can't find any related topic.
I want to use the instr function, but return results from it depending on surtain functions, I can't realy explain so I'll show my example:
I have a string in wich some word I want to find might be in diffrent Capital Letters order, I want the Instr function to return all the values of the place of that word (avcourse I'll run a for and increase the starting point of the Instr func until it returns 0). The instinct thought is to use the Lcase or the Ucase functions, but in this case I don't know how to use them. In the same Idea I wanted to use the Instr Func with the trim Func, But Its realy the same principle if I just understood how to do so.
I am trying to call a function in asp to check to see if a varibale has a value stored in it if there is nothing wite the value NA into it. My code is
<%
Function NullValues(userField)
if userField = "" then userField = "NA"
end function
AccountNo = ""
Name = "sam clowes"
email = ""
AccountNo = (NullValues(AccountNo))
Name = (NullValues(Name))
email = (NullValues(email))
response.Write AccountNo & "<br>"
response.Write Name & "<br>"
response.Write email & "<br>"
%>
When I run this code ALL the variables are blank and nothing is output
the function
<%
Dim objXML, objXSL
Function ShowXML(strXML,strStyleSheet)
Set objXML = CreateObject("MSXML.DOMDocument")
Set objXSL = CreateObject("MSXML.DOMDocument")
objXML.load(Server.MapPath(strXML))
objXSL.load(Server.MapPath(strStyleSheet))
Response.Write objXML.transformNode(objXSL)
Set objXML = Nothing
Set objXSL = Nothing
End Function
%>
calling the function in an asp file
<%Call ShowXML("http://msn.foxsports.com/feedout/syndicatedContent?categoryId=142","nhl/xsl/news/teamNews.xsl")%>
the errors
1. the http:// part
2. and the ? mark
the error message says that the path has been typed wrong.
the user can key in variable A and B
then C is auto generated by C = A / B
so how and where should i write the C function??
Possibly a very simple question but how do I get a value out of an XML document so I can play with it in ASP
E.G: <Name>Tom</Name
How do I pull the work tom into asp
I am using the now() function to be displayed on an email after a form submission has been sent. The problem is that the server is not in the same timezone as I am for the result. How do I adjust the hours on the now() to allow for this please ?
View Replies View RelatedI know the basic difference between a subroutine and a function is a
subroutine performs a task and a function performs a task and returns a
value. The Call keyword is required when using parens with subs with more
than 1 parameters. Parens around values passed are ByVal vs ByRef and is a
waste of processing if passed ByRef for no reason.
I am told there is no reason to ever use a subroutine as a function can be
used even if it doesn't return a value. While this appears to be true, is
there any reason why it's ever a bad idea to use a function, instead of a
subroutine, that doesn't return a value? Are there memory, performance,
etc. issues?
I am trying to locate information on how to call a sub within VBScript on an
ASP page but I can't locate generic information. What I want to do is
generate a page that will stay up but the information on it will change
based on a series of drop down boxes. I need the first drop down box to call
a second dropped down box based on the state that is chosen then city and so
on.
I have a column in the table which contains 2 full names seperated by "&" (e.g: Joe Smith & Jeff Scott) I want to display only the first names of the whole record in an asp page. Is there an asp function using which i can do this?
View Replies View Relatedim using the mod function to create a calendar for me, which everything works perfectly, all is totally well with that!
but...when i use the mod function it churns out this loooooooooong string which is the whole table...
if there is some way that i can insert hard breaks IN THE CODE ITSELF.
I used to be quite an experienced ASP programmer but I haven't used it for a while
I’m trying to do something that I remember as very simple I'm trying to check that the value of a form text box is numerical using the isNaN function. The code I am using is:
<%
quantity = Request.Form("number1")
if isNaN(quantity) = true then
Response.Write "Your input was not a number"
else
Response.Write "Your input was a number"
end if
%>
All I get is a NaN type mismatch error.
Is there a function to check to see if a string contains a space
Thanks
I was just wondering when using the mid function how does the assigment work when the length is longer then string itself? For example
test = mid(12345, 1, 10)
What would be the end result of test?Would it be 0000012345 or 1234500000 or 12345?
When I create a single character string
var str = "A"
'convert to ascii
num = asc(str)
Response.Write num ' 65 shows up
'when I have a whole string
str = "hello"
str = mid(str, 1, 1) ' return 'h'
num = asc(str)
'I get an error:
Invalid procedure call or argument:'asc'What can be done to fix this?
I've an array to store alphabets, in my code...in a random order. How can i use the Asc() function to get the equivalent Ascii of each alaphabaet of that array....
whenever i use ,
for i = 0 to NoOfElements
Response.write Asc("ArrayName(i)")
next
it displays 65, "NOOfElements" times (ascii of A)...on the other hand..i can't write
Response.write Asc(ArrayName(i))
since this shows some error...How can i solve this?
Depending on some situations, I or the user, need to execute a function (e.g., login, sending email, etc...) and then continue from the original place. How can I make one function to be available from any page from my site?
View Replies View RelatedI have a problem with max() function. The SQL is as follow SELECT max(group_no) as group_no FROM doc_groups. if I run the sql in MS SQL server, it will return correct result. However when I run in ASP file, there is no record return. I check with RecordCount property and it return -1.
View Replies View RelatedDoes anyone know how to use the Excel PV Function in an asp page? Is it possible at all? I know how to use it in .Net but not in ASP.
View Replies View Relatedi need to write sql statment to compeare the first three letters btween input user and a field in a database, i used the Mid function but it seems there is something wrong ..
dim str1
str1= Mid((Form1.SiteName.value), 0, 2)
<% strSQL = "SELECT EQUIPMENT_ID FROM ne.equipment_view WHERE Mid([EQUIPMENT_ID], 0, 2) = '&str1&'" %>
by the way i use dropdown list for user input ....
I need function that will recognize URL in some string. For ex. somebody in forum sends some text which is in variable TEXT. I want a function to look at it and if it finds www... , http://... or https:// - he has to change it into url link.
View Replies View Relatedin vbscript:
Int(11.4)=11
What function in JScript like this function?