.vbs Function In A Page?

can I include into an .asp page a script file?

My script file would have a bunch of functions written in VBScript, say, and my asp page also in VBScript.

I want to be able to write a few functions that can be accessed by an .asp page, and also by scripts that run on the web server (e.g. via scheduled tasks).

View Replies


ADVERTISEMENT

How Do I Call A JavaScript Function From An ASP Page?

I have created a JavaScript function to validate values of a parameter. Let's say validate(parm). I have saved the entire file as validate.inc and included in my ASP page as:
<!--#include virtual="/Validate.inc"-->

Now from an ASP page I want to call JavaScript validate function and pass on a parameter, X, to validate. How do I call a JavaScript function from an ASP page?

View Replies View Related

Function To Stop The Remainder Of The Page From Executing

Is there a function in ASP that can stop the remainder of the page from executing?

View Replies View Related

Refresh/update Page When Using Time() Function

I have an asp page in which I use the �time() function but that just gives the time at the moment the page is loaded. I need to reload/refresh the page once every second so the seconds increase by one continuously.

View Replies View Related

ASP Page As Remote Function Call From Javascript

I've been playing with the idea of just how to use an ASP page to provide a
remote function call. In an ideal world this would be a web service but how
can you do it if restricted to ASP 3.0 ?

Idea 1 was to write an ASP page that accepted arguments using the classic
?X=1&Y=2 type of strings and have the page return an ADO disconnected record
set containing the results of the action. This is call very well, and works,
but you do have to allow the browser to create an ADODB.RecordSet in which
to place the results which goes against some security principles. Code:

View Replies View Related

How Do I Call A Function Defined In Html Script Tags From Asp Page?

i have this.asp page:

<script type="text/vbscript">
Function myFunc(val1ok, val2ok)
' do something ok
myFunc = " return something ok"
End Function
</script>

<html>
<body>
<%
val1ok = something1
val2ok = something2
thenewVal = myFunc((val1ok), (val2ok))
%>
</body>
</html>

i want to call and use the returned value of Function myFunc(val1ok,
val2ok) ,without omitting the html script tags and replacing them in <% %>,

(My Question is:) How do i call a function defined in html script tags from asp page?

View Replies View Related

Difference Between Private Function And Public Function?

What's the difference between private and public functions in ASP? When should I use either?

View Replies View Related

How Can I Add Mail Function To That Post Function

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 ....

View Replies View Related

Function Inside A Function

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.

View Replies View Related

Function In The InStr Function

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.

View Replies View Related

ASP Read The Execl Cell's Data, Web Page Created From Excel2000 -- Save As Web Page

I created a web page from Excel2000, using "Save as web page..."...Publish
function. then, I moved htm file to my IIS web server. Then I added a form control, and submit button.

How can get the data on the excel file using ASP from server side?
For example, the value of Cell(1,2), Cell(2,3)....

View Replies View Related

Display Aspx Page Or Reporting Services Page In User Control

What I want to be able to do is create a user control that will display an
entire page page within it. Does anyone know how to do this or better yet
have any same code?

View Replies View Related

How To Transfer A Data Display On 1st Page To 2nd Page Upon Clicking On The Link

I like to know how to write this specifc function on ASP where the user eg: display a set of records on the webpage. Example the data are ID, Name and address.

Lets say i display the data on the webpage and i set the Name as the <a href>. So when i click on the name, it will move to another page with the id of the specific name. Code:

View Replies View Related

An ActiveX Control On This Page Might Be Unsafe To Interact With Other Parts Of The Page ...

I have an ActiveX control in my ASP page that has not been signed yet, so currently just for testing I set the Security for Intranet to "Low". When I run the ASP page on my machine (the IIS is in my machine), I have no problem, except the page prompted me with "An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?"

But, when I run the ASP page on another machine (even though the other machine is also a development machine that already has the ActiveX control and I set the Security for Intranet to "Low"), it did not prompt me the above message, and I got an error when accesing any method of the AX control (e.g Object doesn't support this property or method 'myAXControl.method').

Is this because I have to create a CAB file and mark the AX control as safe for scripting ?To create a CAB file for this AX control, do I need to create my own VB AX
Control project that contains this control and then create a cab file for this VB project ?

View Replies View Related

On Session_OnStart() Getting Fired When Going From Page To Page At The Same Level As The Global.asa

This is a standard ASP application that has several pages at the root
withthe global.asa. I set a session variable session("accountid") =
"123456" within an asp page and then response.redirect to the next page and
immediately response.write session("accountid") and I get back nothing.

But if I set a session variable session("accountid") = "123456" within an
asp page and response.redirect to a page in a sub directory and immediately
response.write session("accountid") I get back 123456 on the screen.

View Replies View Related

Including Inverted Commas To Specify Page Elements While Page Is In ASP

I am having a problem with a site that I am developing - my aim is for it to validate as XHTML Strict however, I am running into a couple of problems validating it; in my Response.Write ASP script, I am not including " 's to define page element tags as they keep throwing up errors in the page. Code:

View Replies View Related

Blank Page Running ASP Page On Windows Vista

I've a strange problem with Windows Vista, running an ASP page on local
machine (http://localhost/test.asp), the page does not give me any error but
the asp code is not executed (simple code : <% response.write("hello") %),
it show me a blank page, I think I've put all the setttings correctly, but
maybe I must do something obvious to fix that.

View Replies View Related

Differentiate Page Requested Versus Page Refresh

I encounter a page reload situation in ASP. It is I need a way to differentiate whether the current page - "Application_Result.asp" got reloaded itself when user click on the browserRefresh button or is requested by the previous page "Application_Form.asp".

I tried using
<%if Request.ServerVariables("REQUEST_METHOD") = "POST" then%>
<!--it is requested from "Application_Form.asp, do something-->
<%else%>
<!--Application_Result.asp refreshed itself(such as user clicks on the
browser Refresh button, do something else-->
<%end if%>

However, in both cases, the IF statement above all evaluated as true. how to differentiate this two different behavior (Page Refresh versus Page requested by another Page) ?

View Replies View Related

Page Can't Directly To Login Page After Session Expired

I have page for user to update his/her details. What i want is after idle for more than 20 mins, the page will redirect to login page automatically. So that the user knows that his/her session already expired and need to login again.

But it doesn't working. This is because if he/she update the details (after idle more than 20 mins), and click the Submit button, it will go to login page and all the data will be lost. Code:

View Replies View Related

Asp Function

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

View Replies View Related

XML/XSL & ASP Function

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.

View Replies View Related

Function

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??

View Replies View Related

XML Value Into ASP 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

View Replies View Related

Now() Function

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 Related

Sub Or Function

I 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?

View Replies View Related

ASP Function

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.

View Replies View Related

Asp Function

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 Related

Mod Function

im 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.

View Replies View Related

NaN Function

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.

View Replies View Related

Contains Function

Is there a function to check to see if a string contains a space
Thanks

View Replies View Related

Mid Function

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?

View Replies View Related

Mid() Function

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?

View Replies View Related

Use Asc() Function

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?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved