Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 25th, 2012  |  syntax: None  |  size: 2.89 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to Run .asp page on vs2010 project
  2. bellow is my asp page syntax:
  3.  
  4. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
  5. <%
  6. If Request("Action")="2" Then
  7.     Response.Cookies("AdminUserID") = ""
  8.     Response.Cookies("Username") = ""
  9.     Session.Abandon()
  10. End If
  11.  %>
  12. <!--#include file="Functions.asp" -->
  13. <%
  14. MM_valUsername=CStr(Request("User"))
  15. If MM_valUsername <> "" Then
  16.   set MM_rsUser = Server.CreateObject("ADODB.Recordset")
  17.   MM_rsUser.ActiveConnection = MM_LocalDB_STRING
  18.   MM_rsUser.Source = "SELECT RepName, RepPassword, RepID"
  19.   MM_rsUser.Source = MM_rsUser.Source & " FROM dbo.SalesReps WHERE RepName='" & Replace(MM_valUsername,"'","''") &"' AND RepPassword='" & Replace(Request("Password"),"'","''") & "'"
  20.   MM_rsUser.CursorType = 0
  21.   MM_rsUser.CursorLocation = 2
  22.   MM_rsUser.LockType = 3
  23.   MM_rsUser.Open
  24.   If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
  25.     ' username and password match - this is a valid user
  26.     Session("Username") = MM_valUsername
  27.     Session("AdminUserID") = MM_rsUser("RepID")
  28.     Response.Cookies("Username") = MM_valUsername
  29.     Response.Cookies("Username").Path = "/"
  30.     Response.Cookies("AdminUserID") = MM_rsUser("RepID")
  31.     Response.Cookies("AdminUserID").Path = "/"
  32.     Response.Cookies("Username").Expires = DateAdd("d",1,Date)
  33.     Response.Cookies("AdminUserID").Expires = DateAdd("d",1,Date)
  34.     Response.Redirect("default.asp")
  35.   Else
  36.     Response.Write("User Name or Password is wrong")
  37.   End If
  38.   MM_rsUser.Close
  39. End If
  40. %>
  41. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  42. <html>
  43. <head>
  44. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  45. <title>1800wheelchair.com - Login</title>
  46. <link href="Styles.css" rel="stylesheet" type="text/css">
  47. </head>
  48.  
  49. <body onLoad="document.Login.User.focus()">
  50. <!--#include file="Header.asp"-->
  51. <form ACTION="login.asp" METHOD="get" name="Login">
  52. <table width="100%" border="0" cellpadding="0" cellspacing="0" height="300">
  53. <tr height="300">
  54. <td align="center">
  55. <table width="275" height="150" border="2" cellpadding="0" cellspacing="0" bgcolor="#EFEFEF" rules="groups">
  56.     <tr>
  57.       <td colspan="2" align="center" class="labelA"><b>User Login</b></td>
  58.     </tr>
  59.     <tr>
  60.     <td class="text">&nbsp;&nbsp;User Name: </td>
  61.     <td><input tabindex="0" name="User" type="text" value="<%= Request("User") %>" size="20"></td>
  62.   </tr>
  63.   <tr>
  64.     <td class="text">&nbsp;&nbsp;Password: </td>
  65.     <td><input name="Password" type="password" value="" size="20"></td>
  66.   </tr>
  67.   <tr>
  68.     <td colspan="2" align="center"><input type="submit" value="Log In"></td>
  69.   </tr>
  70. </table>
  71. </td></tr>
  72. </table>
  73. </form>
  74. </body>
  75. </html>
  76.        
  77. 1)Locally install IIS on your machine.
  78. 2)from start menu run vs as admin
  79. 3)now open the project
  80. 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.
  81. 5)built the solution .
  82. 6)Run the project.
  83. Hope it’s work perfectly