PC Review


Reply
Thread Tools Rate Thread

Classic asp function

 
 
aroth
Guest
Posts: n/a
 
      20th Jan 2004
Hello all, I am just getting started with .net development and have
been playing with various sample apps. I am currently trying to
replicate a function that I have used in my classic asp apps that gets
a user's ntlogin. I normally store it in include file and then run it
before the page loads. Seems simple enough but I can't figure out how
to get it to work with asp.net. For instance, where do I store the
function & how do I call it?
I realize that I will probably get responses sending me to Microsoft's
site and believe me I have been there. What would be helpful is if
anyone knows of a high-level reference comparing the differences
between classic asp and asp.net. Thanks!


include file code:
<script language=jscript runat=server>
function getNTLogin() {
if (Request.ServerVariables("logon_user")=="") {
Response.Status = "401 Auth requested";
Response.End();
} else {
fullLogin = Request.ServerVariables("logon_user") + "";
tmpArray = fullLogin.split("\\");
ntLogin = tmpArray[1];
ntLogin.toLowerCase();
}
return ntLogin;
}
</script>

============================
then my asp page:

<%@ Language=JScript %>
<!-- #include file="inc/include.inc" -->

<% ntlogin = getNTLogin(); %>
<html>
blah blah
display login here: <%=ntlogin%>
 
Reply With Quote
 
 
 
 
Jan Tielens
Guest
Posts: n/a
 
      21st Jan 2004
You could create a class with some static functions:
public class MyFunctions
{
private sub New()
{
// Private Constructor
}

public static string GetUserName()
{
// Implementation
}
}

You could use this function without instantiating the class.

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


"aroth" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello all, I am just getting started with .net development and have
> been playing with various sample apps. I am currently trying to
> replicate a function that I have used in my classic asp apps that gets
> a user's ntlogin. I normally store it in include file and then run it
> before the page loads. Seems simple enough but I can't figure out how
> to get it to work with asp.net. For instance, where do I store the
> function & how do I call it?
> I realize that I will probably get responses sending me to Microsoft's
> site and believe me I have been there. What would be helpful is if
> anyone knows of a high-level reference comparing the differences
> between classic asp and asp.net. Thanks!
>
>
> include file code:
> <script language=jscript runat=server>
> function getNTLogin() {
> if (Request.ServerVariables("logon_user")=="") {
> Response.Status = "401 Auth requested";
> Response.End();
> } else {
> fullLogin = Request.ServerVariables("logon_user") + "";
> tmpArray = fullLogin.split("\\");
> ntLogin = tmpArray[1];
> ntLogin.toLowerCase();
> }
> return ntLogin;
> }
> </script>
>
> ============================
> then my asp page:
>
> <%@ Language=JScript %>
> <!-- #include file="inc/include.inc" -->
>
> <% ntlogin = getNTLogin(); %>
> <html>
> blah blah
> display login here: <%=ntlogin%>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Classic Look Paul W Smith Windows Vista General Discussion 8 24th Sep 2007 02:39 PM
Vista Classic Theme DWM enabled Windows Classic Theme!!! corbomite Windows Vista General Discussion 0 29th Jun 2007 07:26 PM
use vb.net function from classic asp page Kent.Gallinger@gmail.com Microsoft ASP .NET 7 21st Mar 2006 12:47 AM
ASP classic -> ASP.NET 2.0 Spam Catcher Microsoft ASP .NET 3 26th Nov 2005 01:20 PM
new site to discuss classic dos / classic windows (ProteanThread) Freeware 0 7th Jan 2005 02:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:22 AM.