Assigning A Default Value To A Function-variable

Well, it's quite simple, it's easily done in C, but in ASP (and VB in
general) i haven't been able to see it done...

function setvalues(var1, var2="a", var3="b")
if var2="a" then
response.write("Var2 wasn't defined")
end if
if var3="b" then
response.write("Var3 wasn't defined")
end if
end function

I hope it makes sense, and that someone has the solution to it...

View Replies


ADVERTISEMENT

Assigning Variable Value In Global.asa

I'd like to have a variable that I assign a value to for an entire website. It's a variable that contains the DSN name for my ADODB Connection.

This variable value is necessary on every page on the website. Is it incorrect to assign a variable the value in global.asa so it just stays for the entire site?

View Replies View Related

Assigning A Boolean Of True Or False To VBScript Variable...

Is there a way I can assign a value of true or false to a VBScript variable? I have a function where I want to initiate a value of false: Would this work? Code:

View Replies View Related

Home Page - Default Variable?

I'm very new to ASP, but developing a dynamic website using ASP and an Access dbase.

I've created a template page (index.asp) and I plan for this to be the only page required for the whole site as the rest of the content will be loaded dynamically based on variables in the querystring. For example, if the querystring was: index.asp?PageStr=home, the home page content would load, if it was index.asp?PageStr=contact, the contact content would load.

My question is this. If someone went to my domain xyz.com there would be no default variable in the querystring and no content would load. Is there a way round having to create two pages - a default home page and another page for everything else?

View Replies View Related

Passing Variable Into Function

i have a problem when i'm passing a parameter into my function, it gives me an error saying invalid column ts Code:

View Replies View Related

ASP Variable Into Javascript Function

I'm trying to take an ASP session variable and pass it into a javascript function with little success. As the page loads, the session variable is there and the javascript function is called as an include.

I've tried silly ideas like option explicit and using asp to write the javascript declaration of the variable.

View Replies View Related

Function Inside Variable

I'm trying to use a variable like a file and I do not know if it is possible, like this:

varfunc=chr(60)&chr(37)&"function addone(varint) : addone = varint + 1: End function"&chr(37)&chr(62)

Now I have a addone function inside varfunc.

The value of varfunc is <%function addone(varint) : addone = varint + 1: End function%>

Is it possible I use varfunc like a file or something to make the function active? There are some operator like a pointer to variable or somehow to eval like a code block?

View Replies View Related

Javascript Function Passing A Vb Variable

I'm trying to use a javascript function passing a vb variable. I don't understand why it doesn't work. Code:

View Replies View Related

Problem Passing Variable To Function

Here is my code:
...
dim fname
fname = rsAddwg2("file_name")
response.write("<td align=center onclick=""tst(fname);"">" & revno & "</td>")
....

I'm trying to pass te variable fname to function tst, but I keep getting this error message "Error: 'fname' is undefined. I have a feeling that there is something wrong with my syntax but I can't figure it out.

View Replies View Related

Session Variable Within A Javascript Function?

Is it possible to get an asp session variable within a javascript function?

View Replies View Related

Session Variable Inside Function?

I have a function that I would like to use a session variable in. However I am not getting it to work out. I was wondering if you have define global variables inside functions like you do php or if something might be causing this?

View Replies View Related

Passing Asp Session Variable To Js Function

how to pass an asp session variable to a local variable withing a javascript function. Something like this:

var zip = <%=Session("clzip")%>

but it's the quotes around "clzip" that is throwing a syntax error I think. I've tried single quotes and no quaotes. Can't get it to work. Anyone have any ideas?

View Replies View Related

Assigning Values

I know I can use

Dim Array1(item1,item2,item3)
Session("Array2") = Array1

To copy a local array to a session array. What syntax do I use to copy a local array to another local array (without using a loop to load each element)?

View Replies View Related

Assigning The Result

How can I assign the result of a SQL-query to an ASP variable? This is what I have so far but it doesn't seem to work. Code:

dim strSQL
strSQL="select TestID FROM TestID_Description WHERE CL1='" &Request.Form("CL1")& "' AND CL2='" &Request.Form("CL2")& "'AND CL3='" &Request.Form("CL3")& "'AND CL4='" &Request.Form("CL4")& "'AND CL5='" &Request.Form("CL5")& "'AND CL6='" &Request.Form("CL6")& "'"
objRS("TC_Number")=objConn.execute(strSQL)

Maybe it's interesting to know that TC_Number is the primary key of the table.

View Replies View Related

Assigning An ASP Object To A Jscript Var

I have an ASP variable containing an XML object, i want to pass this object to a javascript object .... how can i do that?

one solution i know of is to write the xml in the page as an xml island and retriving this code using the document.getElementById....

is there another way where i can do that directly?

View Replies View Related

Using Checkbox For Assigning Items

I have a catalog of books which need to be categorized into different
groups. Some of the books can be listed under more than one category.
I'm creating a page where I can assign a group of books to a category
by checking the checkbox next to their name (say I've looped out 100
of them, and check some, and not others) then submitting the form for
processing, so that those titles where the checkbox is checked will
get the categoryid number assigned to them on a one-to-many table

I need to know how to read the checkbox value as it comes in if it is
selected or not, if it is, I'll send the isbn in one direction, and if
not, I won't send it at all.

So, how would I read this on the sheet that grabs the values?

View Replies View Related

Assigning Values In A While Loop

I don't know if this is possible, but I have a Do While Not rs.EOF loop that is pulling values from a SQL database and writes it to an html form. I'm trying to figure out how to tally the values as they are siphoned from the database -- I'm assuming I have to set a unique variable equal to that value as it goes through the loop, but I'm not certain how to pull it off. Code:

View Replies View Related

Assigning An Invoice Number To An Order

I am trying to assign an invoice number to orders that are made on my website so that i can combine multiple order numbers into one invoice number. Here is the code i am using to insert the invoice number into the orders table.

It works if there is only one order in the table but if you try and order again it multiplies the orders by the number of invoice rows for example if there was 3 invoice fields it would add the same order 3 times into the order table. Its got stuck in some sort of loop. Code:

View Replies View Related

Default Value

if for list box, check box or radio button. in asp. how can i write to make it a default value??

View Replies View Related

IE's Default

I'm using a binary stream to send down a file from the web server. I've been having trouble with IE and getting it to recognize my file. I've added the filename as a paramater(?filename=file.jpgw) to handle IE's mime type mangling, but I'm still having trouble with IE's default Save As Type being HTML. When we send down a jpgw (geo-jpeg) file IE wants to save it as an HTML file. I've got the correct filename showing in the Filename box, and if I choose the All Files option from the Save As Type drop down then the file is saved with the correct extension. I'd like to have the All Files option choosen by default. I know it's just a couple of clicks but we have some noivce users that can't seem to get that

View Replies View Related

Default

I wrote an application that generates reports.It then presents a page where
I click a button [javascript:print()] to open the print page. However, I
have a fixed printer and would like to know how to print to the default
printer without me clicking anything. So the page will just load up and
print. Or when I click a button. I just don't want the select printer screen
to pop up. Much similar to clicking the print button on top of the address
bar in Internet Explorer.

View Replies View Related

Default.asp

my new site uses default.asp, instead of using index.asp. this is how my old site was done. now i get error 500. is this because it is trying to find index.asp or because my database isn;t workjing properly? i'm tired and being stupid i think. it's reall probably the database, but i just want to make sure in my sleep deprived state.

View Replies View Related

Specify Default Button

I want to make it so that when the user is looking at a rendered ASP page
and they hit the ENTER key, one of the buttons on the form gets "clicked".
In other words I want for the user to not have to click on the button, and
just hit ENTER instead. How do I specify the button?

View Replies View Related

Combo Default Value

This is the code for a combo box, and I would like to make certain value the default value, so that appears unless users select somthing else.

call rs.Open("SELECT * FROM Trim.dbo.luDecisionMaker ORDER BY DecisionMakerName" _
, myCon)

do while not rs.EOF
Response.Write("<OPTION value=" & rs("DecisionMakerID"))
if rs("DecisionMakerID") = nDecisionMaker then
Response.Write(" selected")
end if
Response.Write(">" & _
rs("DecisionMakerName") & "</OPTION>" & Chr(10))
rs.MoveNext
loop

rs.Close

It comes from a table and has PropertyDetailsID(1,2,3,4) and PropertyDetailsname(Fee, 5,10,Other) and for example "Fee" needs to be the dafault value.

View Replies View Related

New User In DB Default

If a new user is added to the database through a webform, and they would usually have immediate access to member only services, is there a way to make them nonactive in a MS access db until an admin activates them?

View Replies View Related

Default Compenent

I am wanting to compress/zip a file up on the server and email it. Is there a default component that should be installed on the server that will compress/zip files? If not is there FREE ones that anyone would suggest?

View Replies View Related

Default Value In Field

with "select @@IDENTITY" i get the value of the last field insered.. i would
like to get also the field.name

View Replies View Related

Default Include

Is it possible to add a default include file to every ASP-page servered on IIS? So I do not have to modify every page.

View Replies View Related

Default Value For Combo Box

How do I make a value the default value for a combo box in ASP 3.0?

What I have below does NOT work, yet I've seen it in HTML file examples before (and works if I put it in a HTML file by itself, but not if I use it in a ASP 3.0 app.

<select name="cboCompany" style="text-align:right; font-size:8pt">
<option value="08">08</option>
<option value="09" selected="true">09</option>
<option value="33">33</option>
<option value="18">18</option>
<option value="17">17</option>
</select>

View Replies View Related

Default Image

The following code works fine for PC but not for MAC. It won't select the default image from the DB. When I check the DB there looks like there is Binary information there but nothing is displayed ....

View Replies View Related

Change The Default

Using a DetailsView to update data in SQL 2005, How do I change the default "Update" hyperlink to a more user friendly button?

View Replies View Related

Default Values

I need a string of code that will allow me to eliminate,exclude,or ignore the default values that are sent in my web form.It is an order form that has hundreds of items.The items not selected show up looking like this in my email box.

ANCPW122=0
p1E1=0.00
ANCPW182=0
p1E2=0.00
ANCPW183=0
p1E3=0.00
ANCPW242=0
p1E4=0.00

and I have to sort through all of them to find the few selected.can any one tell me with some type of loop to eliminate the values returning 0 or 0.00.

View Replies View Related

Default Port

i set up iis 5.0 on my local machine(win2kpro) (on a pvt LAN) at the default port. when i try to access asp it gives http 500 error. i have been able to configure cgi scripts but asp still doesnt work.

View Replies View Related







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