Accessing Variables in ASP
I am trying to access based upon a numeric database field
called "label". How do I display a different menu based upon that
access level: for example, I want to display a menu on a page if
the value of that field is less than 3, a different menu -- with
access to different items -- if the menu value is greater than 3.
How do I do that?
Thanks!
Ross
?Are you certain that will work? I don't mess with ASP much
any more, but
?I seem to remember that ASP processes any include directives
before
?executing the VBScript.
Gary, you are correct in that include directives are
processed first, which is why you can't do true conditional
includes. But the code still works. Both menus 1 and 2 will be
included in the code send to the ASP processor. The VBScript will
then either display the html for menu 1 or 2 depending on the value
of 'label'.
In other words, the script doesn't determine which menu gets
inserted into the code sent to the ASP scripting engine, but it
does determine the html sent to the browser. Hope this makes
sense.
Similar Messages
-
How to access variables outside user exit
Hi,
I'm working with a user exit and my problem is that in a particular moment I have to access variables located outside the scope of the user exit (they are in a standard program)
How can I reach these variables?
thanks in advanceHi,
If they are global variables then you can access them using Global assign technique,
For example,
FIELD-SYMBOLS: <fs_value> TYPE ANY.
ASSIGN ('(SAPMV45A)XVBAK') TO <fs_value>.
It is basically,
ASSIGN ('(<Std. Program Name>)<Variable name>') TO <field symbol>.
NOTE: To make sure they are accessible in your user exit, just put a break-point in the user exit and once you are there in debugging, type in,
(<Std. Program Name>)<Variable name> in the Field names section and if it does not show it in RED then it is accessible..
Hope this helps..
Sri
Message was edited by: Srikanth Pinnamaneni -
How to Access Variables defined in the PopUpWindow
Hi Friends
I am building a flex site using flex builder 2.....
Here I need your help.....
My Problem is how to store a variable from a popup window
I have this problem while in the login window comes as popup
while clicking login button in the page a popup where user
can enter username and password...
after submitting if the login is successufl the popup
vanish...
After a successful login I need to store the logged user name
in the main index page but I am not able to store
At first I created a variable 'loggedUsername' in the popup
panel and after success log i assigned the username to it ... after
it i am not able to get the loggedUsername..
doubting I defined the variable in the main index.mxml page
but this variable is not accessible from the loginwidow.mxml page
where the popup will function...
Heip me
how to store the name if the user login is success..
thanks
Chintu...Lets say you have a public property in your application like
public var name:String = "John Smith";
to access this using an inline item renderer:
<mx:itemRenderer>
<mx:Component>
<mx:VBox>
<mx:TextInput text={outerDocument.name} />
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
To access variables of the applicaton you can use
Application.application.name (for example) to reference "global"
variables, so you might also use this technique. With an inline
item renderer, the outerDocument property will refer to the
component which contains the renderer. -
How to access variables declared in main mxml in itemrenderer files
Hi,
I have a main mxml which has a cutomRenderer that defines two
mxml components
namely raidobutton and textinput.
Now in this TextInput.as i need to access variable defined in
main mxml.
Please suggest a way.
Thanks,
LuckyLets say you have a public property in your application like
public var name:String = "John Smith";
to access this using an inline item renderer:
<mx:itemRenderer>
<mx:Component>
<mx:VBox>
<mx:TextInput text={outerDocument.name} />
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
To access variables of the applicaton you can use
Application.application.name (for example) to reference "global"
variables, so you might also use this technique. With an inline
item renderer, the outerDocument property will refer to the
component which contains the renderer. -
Can't access variables in specific S7-1200 DB's in LabVIEW project
Hi all,
I'm trying to establish a connection between LabVIEW and a Siemens S7-1200 though Ethernet and SIemens OPC Server.
The physical connection is OK (I can ping S7-1200 with no problem).
When I needed to access variables from specifics DB's inside S7-1200 ( I want to access variable DB190,X0.4), I called Siemens support and they said I had to modify the variable's definition when using OPC Scout, from "MX0.4" to "DB190,X0.4", and then it was possible to access this variable.
Same solution (renaming the path) applies to NI OPC Client, I can read and write variables properly.
My problem is that when I try to add variables in LabVIEW Project, I can't find those variables whose address were modified, so I can't access the correct variable in my program.
I tried to change the variable path in Multiple Variable Editor, but it doesn't work either.
Any suggestions on what I can try??First: Avoid the ODBC/JDBC Bridge if at all possible.
It's the worst JDBC driver I've ever seen. It's buggy
and a great hindrance both to learning and to
producing usefull code.I agree that there might be problems with M$ Access, but there are problems with all databases, including MySQL (e.g., no referential integrity in free download version). It's capable enough for the query the OP is trying to execute.
The problem is with his code, not Access or the bridge driver. He'll go through a lot of effort to switch databases and still have this problem. Better to understand what HE'S done wrong and fix it so he'll do it correctly for all databases, including Access.
You just need to be more careful with your query, I'm sure.
% -
Access variables in Package.
Hi I have a apackage called share.server , in which I have defined
Hashtable hash;
i have another file in share package as Impl, here i want to call the "hash"
how can i access the same "hash" in Impl.java from FilServer which is in share.server package.
Please respond urgent, assignment is due soon.
Thanks for any response.what?!
variables belong to classes, not packages. If you want to access variables between classes you need to define some kind of public interface for them (getters and setters... ring any bells?). This is basic basic OOP, and is called encapsulation. First thing you need to do is get a basic 'OOP with java' type book and read it fully. We can't help you if you can't help yourself/ -
Access variables within a timer
How can I access variables within a timer?
I mean variables, that I can use in another class that extends applet i.e.?The Code can be compiled now with the Java Compiler.
But the image won't move on the screen.
import java.applet.*;
import java.awt.*;
import java.util.*;
public class ChangingApplet extends Applet {
private Image EricsBild;
private int x,y;
private TimerTask update;
public void start() {
EricsBild = getImage(getCodeBase(), "heuschrecke.gif");
x=5;y=5;
update = new TimerTask() {
public void run() {
if (x<300) x++;
if (y<200) y++;
if (x>3) x--;
if (y>2) y--;
repaint();
Timer t = new Timer(false);
t.schedule(update, 1000, 1000);
public void stop() {
update.cancel();
public void paint(Graphics g) {
g.drawImage(EricsBild,x,y,this);
} -
Accessing variable in main mxml from component
I have the following problem, i have a main mxml and
component mxml which i import in my main file. I need to access
variable in main mxml file from that component but i don't know how
to reference my main mxml from component? Can someone please help
me with this?
thanks in advanceTry this
this.parentApplication.main_mxml.variableID = 34;
Rgds
JFB
"msabljic" <[email protected]> wrote in
message
news:fd2u5k$a17$[email protected]..
>I have the following problem, i have a main mxml and
component mxml which i
> import in my main file. I need to access variable in
main mxml file from
> that
> component but i don't know how to reference my main mxml
from component?
> Can
> someone please help me with this?
>
> thanks in advance
> -
Call function, pass value, access variable in movieclip class from main stage
i am new to flash as.
I got quite confused on some problems. as the function here
is quite different from c and asp.net.
I have a movieClip named MC, and it's enabled with action
script, with the class name MC_Rectangle
and a Stage.
I override the MC_Rectangle class file in a mc_rectangle.as
external file.
here is the code:
package{
import flash.display.*;
import flash.events.*;
public class MC_Rectangle extends MovieClip {
var sequence:int = new int();
function setSequence(data:int):void{
sequence = data;
function addSequence():void{
sequence ++;
I have new a object in the main stage var
mc_rect:MC_Rectangle = new MC_Rectangle()
question:
in main stage:
1. how can i access the variable "sequence" in "mc_rect"
2. how can i pass parametre from main stage to mc_rect via
function setSequence(data:int)?
3. how can i call the function in addSequence() in mc_rect.
in asp.net, i usually use mc_rect.sequenct,
mc_rect.setSequence(data), mc_rect.addSequence() to achieve my
goals......
btw, can function in mc_rect return out result to main stage?
thanks in advance.Your as-file must be named MC_Rectangle.as (same upper/lower
case as in the Class name)
Ad 1) You have to declare sequence as a public property
"public var sequence;" or - better - define a getter-function for
sequence.
Ad 2) mc_rect.setSequence(8); e. g. (you must write "public"
in the Class-declaration of setSequence)
Ad 3) mc_rect.addSequence(); e. g. (you must write "public"
in the Class-declaration of addSequence)
... and yes, your methods can return a value: Replace "void"
with the proper data type (int, String, ...) and place a "return
myNumber;" or the like in the method's body. -
Problem with Restrict Access to Page with access level using ASP
I'm using Dreamweaver CS3 with ASP-VBScript and an Access
database. The pages were created from scratch for this project,
using those tools all the way through.
I've created a login page, an admin homepage, and add, edit,
and list records pages for three tables. The login page uses the
Server Behavior "Log in User", all other pages use the Server
Behavior "Restrict Access to Page". All of these are based on an
Access Level.
Login seems to work correctly, and redirects to the admin
homepage. From the admin homepage, I can open any other page as
expected, and they initially display correctly. On the add and edit
pages, however,
submitting the form often results in getting logged out, but
not always.
Once this happens, I can log back in, but other problems will
sometimes occur during that second login session. Sometimes,
logouts will occur on pages that worked fine during the first login
session. Sometimes, another session variable that I've setup
manually will change when it shouldn't...as if there were two
values stored for my session variable, and reloading the page
changes to the other value.
This
post seems closest to my experience, but it doesn't look like
there was really an answer beyond "I had to fight with it for a bit
to get it to work":
I suspected that there is some problem with session settings
on the server. We have an almost identical tool on the same server
that was developed with an older version of DW that works more
reliably; it sometimes has problems with the initial login, but
never has a problem after that.
Has anyone experienced problems like this? Any suggestions
for what to check? I'm really pulling my hair out since it's so
unreliable...the kind of problem that goes away when you try to
show someone and comes back when they leave.Hello,
I was thinking that all I would need would be the username, although username and paswsword would be more secure. There are about 50 users and no groups or levels. They are all equal ... same level.
The website is private and there is a general content area for all users and then there will be private areas for each user where proprietary documents will be held. I need to be able to ensure that user 'A' can only see the user 'A' pages, user 'B' can only see user 'B', etc.
I don't really understand what the Dreamweaver script is doing, but the overview sounded like it was the right tool to accomplish what I'm trying to do.
Any assistance greatly appreciated.
thanks. -
Error when accessing Access database in ASP?
for some reason when I try to open my Access database it constantly and consistenly gives me an error message that claim the table or the query is not valid or the table cannot be found. Both the database and the table exist and are accessible with the files and all directories having a rwxr--r-- protection and the code below is extraordinarily simple. Can anybody tell me what's going on? I'm sure it's just a simple mistake, but it's driving me nuts!
Thanks
Ross
========================================================================================== =============================
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!-- #include virtual="/includes/adovbs.inc" -->
<!--#include virtual="/Connections/nextdns.asp" -->
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
%>
<%
MM_nextdns_STRING ="PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("Database\ids2.mdb")
%>
<%=MM_NEXTDNS_STRING%>
<%
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_nextdns_STRING
rs1_cmd.CommandText = "SELECT * FROM [Customer]"
rs1_cmd.Prepared = true
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim rs1_total
Dim rs1_first
Dim rs1_last
' set the record count
rs1_total = rs1.RecordCount
' set the number of rows displayed on this page
If (rs1_numRows < 0) Then
rs1_numRows = rs1_total
Elseif (rs1_numRows = 0) Then
rs1_numRows = 1
End If
' set the first and last displayed record
rs1_first = 1
rs1_last = rs1_first + rs1_numRows - 1
' if we have the correct record count, check the other stats
If (rs1_total <> -1) Then
If (rs1_first > rs1_total) Then
rs1_first = rs1_total
End If
If (rs1_last > rs1_total) Then
rs1_last = rs1_total
End If
If (rs1_numRows > rs1_total) Then
rs1_numRows = rs1_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (rs1_total = -1) Then
' count the total records by iterating through the recordset
rs1_total=0
While (Not rs1.EOF)
rs1_total = rs1_total + 1
rs1.MoveNext
Wend
' reset the cursor to the beginning
If (rs1.CursorType > 0) Then
rs1.MoveFirst
Else
rs1.Requery
End If
' set the number of rows displayed on this page
If (rs1_numRows < 0 Or rs1_numRows > rs1_total) Then
rs1_numRows = rs1_total
End If
' set the first and last displayed record
rs1_first = 1
rs1_last = rs1_first + rs1_numRows - 1
If (rs1_first > rs1_total) Then
rs1_first = rs1_total
End If
If (rs1_last > rs1_total) Then
rs1_last = rs1_total
End If
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p>wwwwwwwwwwwwwwwwwwwwwww</p>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<p><%=(rs1.Fields.Item("ID").Value)%>/ <%=(rs1.Fields.Item("FullName").Value)%> /<%=(rs1.Fields.Item("Email").Value)%></p>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
%>
<%=(rs1_first)%> /
<%=(rs1_last)%> /
<%=(rs1_total)%>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>You may also search for Access help at http://search.microsoft.com/search.aspx?mkt=en-US&setlang=en-US
-
Loading Variables from ASP into Flash
I can find plenty of tutorials detailing how to load
variables from a defined asp page into Flash, but here's my
dilemma...
I have an asp page that is reading a URL with a unique
identifier in it (www.sampleURL.com?id=123456), and then turns the
id number from the URL into a variable. On the same page then, sits
my swf where I need to use LoadVars to pull in that ASP variable
via Actionscript. If I don't have a static asp page to pull the
variables in from and I want to pass the variable within the same
asp page the swf is located on, how do I do it? Many thanks in
advance..."bonzomn65" <[email protected]> wrote in
message
news:ej0630$pjh$[email protected]..
>I can find plenty of tutorials detailing how to load
variables from a
>defined
> asp page into Flash, but here's my dilemma...
>
> I have an asp page that is reading a URL with a unique
identifier in it
> (www.sampleURL.com?id=123456), and then turns the id
number from the URL
> into a
> variable. On the same page then, sits my swf where I
need to use LoadVars
> to
> pull in that ASP variable via Actionscript. If I don't
have a static asp
> page
> to pull the variables in from and I want to pass the
variable within the
> same
> asp page the swf is located on, how do I do it? Many
thanks in advance...
>
You don't need LoadVars for this at all. You can just pass
the variable to
your Flash movie by specifying a query string when you are
calling the
movie.
If you are using the straight object, embed method then it
would look
something like this:
<param name="movie" value="movie.swf?id=11111">
<embed src="movie.swf?id=11111" ... >
If you are using the ActiveContent JavaScript for your movie
then you just
leave off the .swf... so
"name", "movie?id=11111"
Then, in flash you can access the value of id from the _root,
like
var idInFlash:Number = _root.id;
Of course in the above example you would replace 11111 with
the proper
syntax for printing a variable's value in ASP. -
How to access variables in webservice
Hai,
I am using SAP Netweaver Developer Studio. I want to handle the error codes by using a variable in the session bean. but i am not able to access the variable . please help me asap.ok, the answer is here
http://blog.flexexamples.com/2008/08/28/creating-a-component-instance-by-class-name-in-act ionscript-30/ -
Open an Access database from ASP on the Windows 2008 32-bit server
We are upgrading to a Windows 2008 server. The ASP application opens an Access database with this code:
Set oConn=Server.CreateObject("ADODB.connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=E:\webdata\applications\po\sfisnet\sfisnet.mdb;"
The open statement causes this error:
Number: -2147217887
Description: Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done.
Source: Microsoft JET Database Engine
SQL State:
Native Error: 0
Research includes:
- ODBC drivers
- verified that the ms jet dll is present: msjet40.dll, msjet35.dll
- IIS settings reviewed
- permission and sharing on the directory and "sfisnet.mdb" database
- verifies thet OLEDB_SERVICES is in the registryThey'll help you over here.
Microsoft ASP.Net forums
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights. -
How to access variables indirectly using JSTL
Hi,
I have a variable called titleInsert pointing to a session variable someSessionVariable. The jsp has access to titleInsert but would like to output the value of someSessionVariable which is pointed to by tilesInsert.
If I have something like
<c:out value="${titleInsert}"/>
the name of the session variable is being displayed but not the value.
I tried something like
<c:out value="$${titleInsert}"/> and
<c:out value="${${titleInsert}}"/> and both resulted in JSP exceptions.
Is there a way to display the value of someSessionVariable?
Help appreicated,
KumarYou use the implicit variable sessionScope, and the square brackets notation.
<c:out value="${sessionScope[titleInsert]}"/>Cheers,
evnafets
Maybe you are looking for
-
Page incorrectly displayed in browser (Was: Please Help)
Hello all. I have been working on a website in DW CS6 and everything was working well, when all of a sudden, I went to view the pages in a browser and they are completely screwed up. It looks as though they are not connected to the Styles sheet, but
-
Hello friends We are having a scenario where we are connecting to an LDAP server from XI .Can anybody help us in this or give us a solution regarding this
-
T450S WinPE x32 Network Drivers for Win7x32
Hi, Has anyone been able to image T450s with Win7x32 SP1? When the WinPE comes up, it cannot find the drivers evetho I added: -Intel(R) Ethernet Connection I217-LM -Intel(R) Ethernet Connection I354 1.0 GbE Backplane Can anyone pls tell me what else
-
Good day all, Users on IM and Presence can collaborate locally on my LAN using Jabber. I need them to be able to still use the application over the internet. I have a public IP address I can use to achieve this. Kindly advice me on how to configure m
-
Power consumption on Thinkpad X200 / X200T
Hello there, Is anyone running Arch on a X200T or X200? I would be interested in your power consumption and your settings to achieve that consumption. I get around 10 to 11W with tlp installed (takes into account all powertop recommendations), PHC re