- How to Run .asp page on vs2010 project
- bellow is my asp page syntax:
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
- <%
- If Request("Action")="2" Then
- Response.Cookies("AdminUserID") = ""
- Response.Cookies("Username") = ""
- Session.Abandon()
- End If
- %>
- <!--#include file="Functions.asp" -->
- <%
- MM_valUsername=CStr(Request("User"))
- If MM_valUsername <> "" Then
- set MM_rsUser = Server.CreateObject("ADODB.Recordset")
- MM_rsUser.ActiveConnection = MM_LocalDB_STRING
- MM_rsUser.Source = "SELECT RepName, RepPassword, RepID"
- MM_rsUser.Source = MM_rsUser.Source & " FROM dbo.SalesReps WHERE RepName='" & Replace(MM_valUsername,"'","''") &"' AND RepPassword='" & Replace(Request("Password"),"'","''") & "'"
- MM_rsUser.CursorType = 0
- MM_rsUser.CursorLocation = 2
- MM_rsUser.LockType = 3
- MM_rsUser.Open
- If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
- ' username and password match - this is a valid user
- Session("Username") = MM_valUsername
- Session("AdminUserID") = MM_rsUser("RepID")
- Response.Cookies("Username") = MM_valUsername
- Response.Cookies("Username").Path = "/"
- Response.Cookies("AdminUserID") = MM_rsUser("RepID")
- Response.Cookies("AdminUserID").Path = "/"
- Response.Cookies("Username").Expires = DateAdd("d",1,Date)
- Response.Cookies("AdminUserID").Expires = DateAdd("d",1,Date)
- Response.Redirect("default.asp")
- Else
- Response.Write("User Name or Password is wrong")
- End If
- MM_rsUser.Close
- End If
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>1800wheelchair.com - Login</title>
- <link href="Styles.css" rel="stylesheet" type="text/css">
- </head>
- <body onLoad="document.Login.User.focus()">
- <!--#include file="Header.asp"-->
- <form ACTION="login.asp" METHOD="get" name="Login">
- <table width="100%" border="0" cellpadding="0" cellspacing="0" height="300">
- <tr height="300">
- <td align="center">
- <table width="275" height="150" border="2" cellpadding="0" cellspacing="0" bgcolor="#EFEFEF" rules="groups">
- <tr>
- <td colspan="2" align="center" class="labelA"><b>User Login</b></td>
- </tr>
- <tr>
- <td class="text"> User Name: </td>
- <td><input tabindex="0" name="User" type="text" value="<%= Request("User") %>" size="20"></td>
- </tr>
- <tr>
- <td class="text"> Password: </td>
- <td><input name="Password" type="password" value="" size="20"></td>
- </tr>
- <tr>
- <td colspan="2" align="center"><input type="submit" value="Log In"></td>
- </tr>
- </table>
- </td></tr>
- </table>
- </form>
- </body>
- </html>
- 1)Locally install IIS on your machine.
- 2)from start menu run vs as admin
- 3)now open the project
- 4)From project file set the virtual path.if your local pc os is windows7 need to define the iis port default port is 8080.
- 5)built the solution .
- 6)Run the project.
- Hope it’s work perfectly