Classic asp
Classic asp
 Learn FrontEnd Technologies( HTML,CSS,Javascript)
 Install IIS
 Control Panel -> Programs and Features -> Turn Windows Feature on or off
 select internet information services
 Go to world wide web services -> Application Development Features
 Select asp and asp.net
 Go to Web Management Tools -> IIS 6 Management Compatibility
 Select IIS Metabase and IIS 6 configuration compatibility
 Click OK Button , it will take time , close window when it completes.
 Go to Start and serach iis.
 Open Internet Information Services (IIS) Manager.
 This is now becomes your Classic asp Server.
Classic asp
 Now in IIS Manager, There is 3 Panel
 Connections ( Left Side Panel )
 Content ( Middle Panel )
 Actions ( Right Side Panel )
 Right Click on Sites(Connections Panel)
 Click Add Web Site and new window Comes.
 Add your Website Name (ex.www.local_Facebook.com)
 Add Physical Path : local directory where you save your files for this Website.
 Hostname : its url throught which others can come to your Site.(ex. Same as
website name)
 You can Set your site default page and custom error pages via default
document in Content(Middle) Panel in features view tab.
Classic asp
 If your Site is local (Not purchase any Domain)
 Click on Start -> write run -> click enter -> In Run Window write drivers and
click Enter
 On Window Explorer -> Go to “etc” Folder -> open hosts file in text editor
 GO to the end ->add “127.0.0.1 www.local_Facebook.com” line and save it
 You can select your site in CONNECTION panel and in CONTENT panel
select Content View Tab and you move to your file , select file and Go to
ACTIONS panel -> click on Browse
 You can add multiple bindings in one site and Make 2 sites working with
same data.
 You can change physical path ; restart and stop server as well.
 In Features View click ASP ->Compilation -> Send Errors to browser -
>true to get server error in browser.
Classic asp(Programming)
 Classic asp is one type of HTML File Contains asp code in between
“<%”,“%>” Tags
 IIS Server Compile asp File data between “<%” and “%>”
 You can create variable by “<%Dim Variablename%>”
 Add value by “<%Variablename = “My Name is Parakram” %>”
 Print value by “<%Response.write(Variablename)%> or
<%=Variablename%>”
 You can Stop Debugging by “<%Response.end%>” , This is also use to
check the issue without fully execution of page.
 I will Give you basic of insert ,update and delete operation in classic asp on
next slide.
Classic asp(Programming)
 <%conn_string= “Provider=SQLNCLI11.1;Data Source=server;Database=Parakram;UID=username; PWD=password;”
 Set conn = Server.CreateObject("ADODB.Connection")
 conn.open conn_string
 ‘insert code ,you can add comment by single quote
 ‘to get submitted variable in url , use method get %>
 AddUser.asp File
 <form method="post" action="processuser.asp" name="FrontPage_Form1">
 <input type=“hidden” name=“mode” value=“Add”>
 Username : <input type="text" name="name" size=20>
 Password : <input type="text" name="password" size=20>
 User Category : <select name="category"><option value="Admin">Admin</option><option value="Standard">Standard
</option><option value="Read Only">Read Only</option></select>
 <input type="submit" name="Submit" value="Add/Update Info">
 </form>
Classic asp(Programming)
 ViewUser.asp File
 <%conn_string= “Provider=SQLNCLI11.1;Data Source=server;Database=Parakram;UID=username; PWD=password;”
 Set conn = Server.CreateObject("ADODB.Connection")
 conn.open conn_string%>
 <table>
 <tr>
 <td >Username</td>
 <td >Password</td>
 <td >Category</td>
 </tr>
 <%Set rsData = Server.CreateObject("ADODB.Recordset")
 rsData.Open “SELECT * FROM users”, conn, 3, 3
 if not rsData.eof then
 While not rsData.eof%>
 <tr><td><font face=arial size=2><%=rsData("username")%></td>
 <td><font face=arial size=2><%=rsData(" password ")%></td>
 <td><font face=arial size=2><%=rsData(" category ")%></td>
 <td> <a href="edituser.asp?id=<%=rsData("id")%>">edit</a> </td>
 <td> <a href=“processuser.asp?id=<%=rsData("id")%>&mode=delete">delete</a>
 </tr>
 <%rsData.movenext
 Wend
 End if%>
 </table>
Classic asp(Programming)
 EditUser.asp File
 <%conn_string= “Provider=SQLNCLI11.1;Data Source=server;Database=Parakram;UID=username; PWD=password;”
 Set conn = Server.CreateObject("ADODB.Connection")
 conn.open conn_string
 id = request.querystring("id")
 rsData.Open “SELECT * FROM users where id=”& id, conn, 3, 3
 if not rsData.eof then%>
 <form method="post" action="processuser.asp" name="FrontPage_Form1" >
 <input type=“hidden” name=“mode” value=“Edit”>
 <tr><td> <input type=“text" name="password" value="<%=rsData("username")%>"> </td>
 <td> <input type=“text" name="password" value="<%=rsData("password")%>"> </td>
 <td>
 <select name="category">
 <option <%if rsData("category") =“Admin” then%> selected <%End if%> value="Admin">Admin</option>
 <option <%if rsData("category") =“Standard” then%> selected <%End if%> value="Standard">Standard</option>
 <option <%if rsData("category") =“Read Only” then%> selected <%End if%> value="Read Only">Read Only</option>
 </select>
 </td>
 <td> <input type="submit" name="Submit" value="Update Info"> </td></tr>
 </form>
 <%End if%>
Classic asp(Programming)
ProcessUser.asp File
 <%conn_string= “Provider=SQLNCLI11.1;Data Source=server;Database=Parakram;UID=username; PWD=password;”
 Set conn = Server.CreateObject("ADODB.Connection")
 conn.open conn_string
 mode = request (“mode")
 If mode=“Edit” then
 id = request("id")
 rsData.open "users where id = " & id & "", conn, 3, 3
 rsData("username") = request(“username”)
 rsData("category") = request(“category”)
 rsData("password") = request(“password”)
 rsData.update
 rsdata.close
 Set rsdata = Nothing
ProcessUser.asp File(Conti.)
 Elseif mode = “Add” then
 rsData.open "users", conn, 3, 3
 rsData("username") = request(“username”)
 rsData("category") = request(“category”)
 rsData("password") = request(“password”)
 rsData.update
 rsdata.close
 Set rsdata = Nothing
 Else
 SQL = "DELETE FROM users WHERE id = " & request(“id”) & ""
 Set RS= conn.Execute(SQL)
 End if
 %>
Classic asp(Programming)

Classic asp , VB.net insert update delete crud

  • 1.
  • 2.
    Classic asp  LearnFrontEnd Technologies( HTML,CSS,Javascript)  Install IIS  Control Panel -> Programs and Features -> Turn Windows Feature on or off  select internet information services  Go to world wide web services -> Application Development Features  Select asp and asp.net  Go to Web Management Tools -> IIS 6 Management Compatibility  Select IIS Metabase and IIS 6 configuration compatibility  Click OK Button , it will take time , close window when it completes.  Go to Start and serach iis.  Open Internet Information Services (IIS) Manager.  This is now becomes your Classic asp Server.
  • 3.
    Classic asp  Nowin IIS Manager, There is 3 Panel  Connections ( Left Side Panel )  Content ( Middle Panel )  Actions ( Right Side Panel )  Right Click on Sites(Connections Panel)  Click Add Web Site and new window Comes.  Add your Website Name (ex.www.local_Facebook.com)  Add Physical Path : local directory where you save your files for this Website.  Hostname : its url throught which others can come to your Site.(ex. Same as website name)  You can Set your site default page and custom error pages via default document in Content(Middle) Panel in features view tab.
  • 4.
    Classic asp  Ifyour Site is local (Not purchase any Domain)  Click on Start -> write run -> click enter -> In Run Window write drivers and click Enter  On Window Explorer -> Go to “etc” Folder -> open hosts file in text editor  GO to the end ->add “127.0.0.1 www.local_Facebook.com” line and save it  You can select your site in CONNECTION panel and in CONTENT panel select Content View Tab and you move to your file , select file and Go to ACTIONS panel -> click on Browse  You can add multiple bindings in one site and Make 2 sites working with same data.  You can change physical path ; restart and stop server as well.  In Features View click ASP ->Compilation -> Send Errors to browser - >true to get server error in browser.
  • 5.
    Classic asp(Programming)  Classicasp is one type of HTML File Contains asp code in between “<%”,“%>” Tags  IIS Server Compile asp File data between “<%” and “%>”  You can create variable by “<%Dim Variablename%>”  Add value by “<%Variablename = “My Name is Parakram” %>”  Print value by “<%Response.write(Variablename)%> or <%=Variablename%>”  You can Stop Debugging by “<%Response.end%>” , This is also use to check the issue without fully execution of page.  I will Give you basic of insert ,update and delete operation in classic asp on next slide.
  • 6.
    Classic asp(Programming)  <%conn_string=“Provider=SQLNCLI11.1;Data Source=server;Database=Parakram;UID=username; PWD=password;”  Set conn = Server.CreateObject("ADODB.Connection")  conn.open conn_string  ‘insert code ,you can add comment by single quote  ‘to get submitted variable in url , use method get %>  AddUser.asp File  <form method="post" action="processuser.asp" name="FrontPage_Form1">  <input type=“hidden” name=“mode” value=“Add”>  Username : <input type="text" name="name" size=20>  Password : <input type="text" name="password" size=20>  User Category : <select name="category"><option value="Admin">Admin</option><option value="Standard">Standard </option><option value="Read Only">Read Only</option></select>  <input type="submit" name="Submit" value="Add/Update Info">  </form>
  • 7.
    Classic asp(Programming)  ViewUser.aspFile  <%conn_string= “Provider=SQLNCLI11.1;Data Source=server;Database=Parakram;UID=username; PWD=password;”  Set conn = Server.CreateObject("ADODB.Connection")  conn.open conn_string%>  <table>  <tr>  <td >Username</td>  <td >Password</td>  <td >Category</td>  </tr>  <%Set rsData = Server.CreateObject("ADODB.Recordset")  rsData.Open “SELECT * FROM users”, conn, 3, 3  if not rsData.eof then  While not rsData.eof%>  <tr><td><font face=arial size=2><%=rsData("username")%></td>  <td><font face=arial size=2><%=rsData(" password ")%></td>  <td><font face=arial size=2><%=rsData(" category ")%></td>  <td> <a href="edituser.asp?id=<%=rsData("id")%>">edit</a> </td>  <td> <a href=“processuser.asp?id=<%=rsData("id")%>&mode=delete">delete</a>  </tr>  <%rsData.movenext  Wend  End if%>  </table>
  • 8.
    Classic asp(Programming)  EditUser.aspFile  <%conn_string= “Provider=SQLNCLI11.1;Data Source=server;Database=Parakram;UID=username; PWD=password;”  Set conn = Server.CreateObject("ADODB.Connection")  conn.open conn_string  id = request.querystring("id")  rsData.Open “SELECT * FROM users where id=”& id, conn, 3, 3  if not rsData.eof then%>  <form method="post" action="processuser.asp" name="FrontPage_Form1" >  <input type=“hidden” name=“mode” value=“Edit”>  <tr><td> <input type=“text" name="password" value="<%=rsData("username")%>"> </td>  <td> <input type=“text" name="password" value="<%=rsData("password")%>"> </td>  <td>  <select name="category">  <option <%if rsData("category") =“Admin” then%> selected <%End if%> value="Admin">Admin</option>  <option <%if rsData("category") =“Standard” then%> selected <%End if%> value="Standard">Standard</option>  <option <%if rsData("category") =“Read Only” then%> selected <%End if%> value="Read Only">Read Only</option>  </select>  </td>  <td> <input type="submit" name="Submit" value="Update Info"> </td></tr>  </form>  <%End if%>
  • 9.
    Classic asp(Programming) ProcessUser.asp File <%conn_string= “Provider=SQLNCLI11.1;Data Source=server;Database=Parakram;UID=username; PWD=password;”  Set conn = Server.CreateObject("ADODB.Connection")  conn.open conn_string  mode = request (“mode")  If mode=“Edit” then  id = request("id")  rsData.open "users where id = " & id & "", conn, 3, 3  rsData("username") = request(“username”)  rsData("category") = request(“category”)  rsData("password") = request(“password”)  rsData.update  rsdata.close  Set rsdata = Nothing
  • 10.
    ProcessUser.asp File(Conti.)  Elseifmode = “Add” then  rsData.open "users", conn, 3, 3  rsData("username") = request(“username”)  rsData("category") = request(“category”)  rsData("password") = request(“password”)  rsData.update  rsdata.close  Set rsdata = Nothing  Else  SQL = "DELETE FROM users WHERE id = " & request(“id”) & ""  Set RS= conn.Execute(SQL)  End if  %> Classic asp(Programming)