Ask a Question related to ASP, Design and Development.
-
BP Prgm #1
Reference a VBScript Variable in ASP
This is my VBScript function:
<script language="JavaScript" type="text/JavaScript">
Dim UN
Set objNet = CreateObject("WScript.NetWork")
Set objUser = GetObject("WinNT://my domain/" & objNet.UserName )
UN = objNet.UserName & " (" & objUser.FullName & ")"
</script>
How can I reference the VBScript Variable UN in my ASP code?
<%=UN%> won't work because VBScript is on the client side and ASP is on the
server side
If I have to post it on one page and read it on another, how do I do that?
I'm somewhat new to ASP...
Thanks!
BP Prgm Guest
-
Reference a variable in a repeater
I have some code that worked fine until a created a repeater. I get an error (BC30451) that I've researched on Google groups, etc., to no avail. ... -
Help with variable reference in perl OOD
I need to be able to set a variable equal to the value of an OOD reference such that when the reference changes, the the variable changes as well... -
Returning a reference to a class variable
I have a class which contains (1) a class variable and (2) a method (e.g., methodA) which returns a reference to the class variable. If the... -
Variable reference
Par <paer_nystroem@hotmail.com> wrote: $var{ $part1 . $part2 } or $var{ "$part1$part2" } -- -
passing javascript variable into asp variable using vbscript
The subject pretty much sums up what I need to do. Here is what I have so far, but still can't figure out how to get it working: <script... -
Bob Barrows #2
Re: Reference a VBScript Variable in ASP
BP Prgm wrote:
Well, you could do this:> This is my VBScript function:
>
> <script language="JavaScript" type="text/JavaScript">
> Dim UN
> Set objNet = CreateObject("WScript.NetWork")
> Set objUser = GetObject("WinNT://my domain/" & objNet.UserName )
> UN = objNet.UserName & " (" & objUser.FullName & ")"
> </script>
>
> How can I reference the VBScript Variable UN in my ASP code?
> <%=UN%> won't work because VBScript is on the client side and ASP is
> on the server side
>
> If I have to post it on one page and read it on another, how do I do
> that? I'm somewhat new to ASP...
>
<form id = frmLogin action="somepage.asp" method="post>
<input type=text style="visibility:hidden" id=txtLogin>
</form>
<script language="JavaScript" type="text/JavaScript">
Dim UN
Set objNet = CreateObject("WScript.NetWork")
Set objUser = GetObject("WinNT://my domain/" & objNet.UserName )
UN = objNet.UserName & " (" & objUser.FullName & ")"
frmLogin.txtLogin.value = UN
frmLogin.submit
</script>
And in somepage.asp:
<%
user = Request.Form("txtLogin")
%>
But, why bother? Use IIS Manager to configure your site to use Windows
Authentication and turn off Anonymous access. Then in ASP, use
user=Request.servervariables("LOGIN_USER")
to get the fully qualified login name of the user.
HTH,
Bob Barrows
Bob Barrows Guest
-
BP Prgm #3
Re: Reference a VBScript Variable in ASP
I have used that, but I want to get some other items like the user's full
name and computer name. Is there a way I can conversely use ASP variables in
VBScript? That way I can put everything on one page and just use the
user=Request.servervariables("LOGIN_USER") to get the other info with
VBScript.
"Bob Barrows" <reb_01501@yahoo.com> wrote in message
news:Ohu3kqwVDHA.2192@TK2MSFTNGP10.phx.gbl...> BP Prgm wrote:>> > This is my VBScript function:
> >
> > <script language="JavaScript" type="text/JavaScript">
> > Dim UN
> > Set objNet = CreateObject("WScript.NetWork")
> > Set objUser = GetObject("WinNT://my domain/" & objNet.UserName )
> > UN = objNet.UserName & " (" & objUser.FullName & ")"
> > </script>
> >
> > How can I reference the VBScript Variable UN in my ASP code?
> > <%=UN%> won't work because VBScript is on the client side and ASP is
> > on the server side
> >
> > If I have to post it on one page and read it on another, how do I do
> > that? I'm somewhat new to ASP...
> >
> Well, you could do this:
>
> <form id = frmLogin action="somepage.asp" method="post>
> <input type=text style="visibility:hidden" id=txtLogin>
> </form>
> <script language="JavaScript" type="text/JavaScript">
> Dim UN
> Set objNet = CreateObject("WScript.NetWork")
> Set objUser = GetObject("WinNT://my domain/" & objNet.UserName )
> UN = objNet.UserName & " (" & objUser.FullName & ")"
> frmLogin.txtLogin.value = UN
> frmLogin.submit
> </script>
>
> And in somepage.asp:
>
> <%
> user = Request.Form("txtLogin")
> %>
>
> But, why bother? Use IIS Manager to configure your site to use Windows
> Authentication and turn off Anonymous access. Then in ASP, use
>
> user=Request.servervariables("LOGIN_USER")
>
> to get the fully qualified login name of the user.
>
> HTH,
> Bob Barrows
>
>
BP Prgm Guest
-
Curt_C [MVP] #4
Re: Reference a VBScript Variable in ASP
can't get computer name....sorry...
You MAY be able to get the full name if you have access to the AD info with
ADSI
--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
[url]http://www.Darkfalz.com[/url]
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------
"BP Prgm" <nospam@please.com> wrote in message
news:ejqeqJxVDHA.424@TK2MSFTNGP11.phx.gbl...in> I have used that, but I want to get some other items like the user's full
> name and computer name. Is there a way I can conversely use ASP variables> VBScript? That way I can put everything on one page and just use the
> user=Request.servervariables("LOGIN_USER") to get the other info with
> VBScript.
>
>
> "Bob Barrows" <reb_01501@yahoo.com> wrote in message
> news:Ohu3kqwVDHA.2192@TK2MSFTNGP10.phx.gbl...>> > BP Prgm wrote:> >> > > This is my VBScript function:
> > >
> > > <script language="JavaScript" type="text/JavaScript">
> > > Dim UN
> > > Set objNet = CreateObject("WScript.NetWork")
> > > Set objUser = GetObject("WinNT://my domain/" & objNet.UserName )
> > > UN = objNet.UserName & " (" & objUser.FullName & ")"
> > > </script>
> > >
> > > How can I reference the VBScript Variable UN in my ASP code?
> > > <%=UN%> won't work because VBScript is on the client side and ASP is
> > > on the server side
> > >
> > > If I have to post it on one page and read it on another, how do I do
> > > that? I'm somewhat new to ASP...
> > >
> > Well, you could do this:
> >
> > <form id = frmLogin action="somepage.asp" method="post>
> > <input type=text style="visibility:hidden" id=txtLogin>
> > </form>
> > <script language="JavaScript" type="text/JavaScript">
> > Dim UN
> > Set objNet = CreateObject("WScript.NetWork")
> > Set objUser = GetObject("WinNT://my domain/" & objNet.UserName )
> > UN = objNet.UserName & " (" & objUser.FullName & ")"
> > frmLogin.txtLogin.value = UN
> > frmLogin.submit
> > </script>
> >
> > And in somepage.asp:
> >
> > <%
> > user = Request.Form("txtLogin")
> > %>
> >
> > But, why bother? Use IIS Manager to configure your site to use Windows
> > Authentication and turn off Anonymous access. Then in ASP, use
> >
> > user=Request.servervariables("LOGIN_USER")
> >
> > to get the fully qualified login name of the user.
> >
> > HTH,
> > Bob Barrows
> >
> >
>
Curt_C [MVP] Guest
-
Bob Barrows #5
Re: Reference a VBScript Variable in ASP
In our Intranet, I have found that I am SOMETIMES able to get the computer
name via "REMOTE_NAME". Sometimes this servervariable only contains the ip
address of the machine - no idea why.
Bob
Curt_C [MVP] wrote:> can't get computer name....sorry...
> You MAY be able to get the full name if you have access to the AD
> info with ADSI
>
>
>
> "BP Prgm" <nospam@please.com> wrote in message
> news:ejqeqJxVDHA.424@TK2MSFTNGP11.phx.gbl...>> I have used that, but I want to get some other items like the user's
>> full name and computer name. Is there a way I can conversely use ASP
>> variables in VBScript? That way I can put everything on one page and
>> just use the user=Request.servervariables("LOGIN_USER") to get the
>> other info with VBScript.
>>
>>
>> "Bob Barrows" <reb_01501@yahoo.com> wrote in message
>> news:Ohu3kqwVDHA.2192@TK2MSFTNGP10.phx.gbl...>>> BP Prgm wrote:
>>>> This is my VBScript function:
>>>>
>>>> <script language="JavaScript" type="text/JavaScript">
>>>> Dim UN
>>>> Set objNet = CreateObject("WScript.NetWork")
>>>> Set objUser = GetObject("WinNT://my domain/" & objNet.UserName )
>>>> UN = objNet.UserName & " (" & objUser.FullName & ")"
>>>> </script>
>>>>
>>>> How can I reference the VBScript Variable UN in my ASP code?
>>>> <%=UN%> won't work because VBScript is on the client side and ASP
>>>> is on the server side
>>>>
>>>> If I have to post it on one page and read it on another, how do I
>>>> do that? I'm somewhat new to ASP...
>>>>
>>>
>>> Well, you could do this:
>>>
>>> <form id = frmLogin action="somepage.asp" method="post>
>>> <input type=text style="visibility:hidden" id=txtLogin>
>>> </form>
>>> <script language="JavaScript" type="text/JavaScript">
>>> Dim UN
>>> Set objNet = CreateObject("WScript.NetWork")
>>> Set objUser = GetObject("WinNT://my domain/" & objNet.UserName )
>>> UN = objNet.UserName & " (" & objUser.FullName & ")"
>>> frmLogin.txtLogin.value = UN
>>> frmLogin.submit
>>> </script>
>>>
>>> And in somepage.asp:
>>>
>>> <%
>>> user = Request.Form("txtLogin")
>>> %>
>>>
>>> But, why bother? Use IIS Manager to configure your site to use
>>> Windows Authentication and turn off Anonymous access. Then in ASP,
>>> use
>>>
>>> user=Request.servervariables("LOGIN_USER")
>>>
>>> to get the fully qualified login name of the user.
>>>
>>> HTH,
>>> Bob Barrows
Bob Barrows Guest



Reply With Quote

