Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Class property into html text boxes

Class property into html text boxes

Scheduled Pinned Locked Moved ASP.NET
databasequestionhtmlsysadminhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brent Lamborn
    wrote on last edited by
    #1

    Does anyone know how I would go about taking the info stored in a class property and inserting it into my html page? Here is my asp code: <%@ Language="VBScript" <%Option Explicit%> <% If Session("SuccessfulLogin") = False then Session( "loginFailure") = True Call Response.Redirect ("login.asp") End if %> Alumnus Edit Page <% Dim objDBConnection Dim objDBRecordSet Dim strDBConnectionString Dim strSQL Dim Alum Set Alum = New Alumnus 'Build query string strSQL = "SELECT Title, FirstName, Lastname, MaidenName, StreetAddress, City, State, Email, Phone, GradDate, DOB, Spouse, Occupation, Activities, Comments, Pssword FROM Alumnus WHERE Email = '" & Session("CurrentUser") & "' " 'Create a ADO connection Set objDBConnection = Server.CreateObject ( "ADODB.Connection" ) 'Open connection objDBConnection.Open("brent") 'Create a record set to hold info from query Set objDBRecordSet = Server.CreateObject("ADODB.Recordset") 'Send query to database and store results in objDBRecordSet objDBRecordSet.Open strSQL, objDBConnection 'Assign property to value in recordset Alum.FirstName = objDBRecordSet("FirstName").Value 'Close record set and connection and destroy object references objDBRecordSet.Close() Set objRecordSet = Nothing objDBConnection.Close() Set objDBConnection = Nothing Call Response.Write("Here is your first name: " & Alum.FirstName) 'How do i get my object properties into text boxes? %> When I call reponse.write it works, I just need help getting the info into the html boxes on my page so they can be edited and resubmitted to my Access database. Thanks for any help... Brent

    H 1 Reply Last reply
    0
    • B Brent Lamborn

      Does anyone know how I would go about taking the info stored in a class property and inserting it into my html page? Here is my asp code: <%@ Language="VBScript" <%Option Explicit%> <% If Session("SuccessfulLogin") = False then Session( "loginFailure") = True Call Response.Redirect ("login.asp") End if %> Alumnus Edit Page <% Dim objDBConnection Dim objDBRecordSet Dim strDBConnectionString Dim strSQL Dim Alum Set Alum = New Alumnus 'Build query string strSQL = "SELECT Title, FirstName, Lastname, MaidenName, StreetAddress, City, State, Email, Phone, GradDate, DOB, Spouse, Occupation, Activities, Comments, Pssword FROM Alumnus WHERE Email = '" & Session("CurrentUser") & "' " 'Create a ADO connection Set objDBConnection = Server.CreateObject ( "ADODB.Connection" ) 'Open connection objDBConnection.Open("brent") 'Create a record set to hold info from query Set objDBRecordSet = Server.CreateObject("ADODB.Recordset") 'Send query to database and store results in objDBRecordSet objDBRecordSet.Open strSQL, objDBConnection 'Assign property to value in recordset Alum.FirstName = objDBRecordSet("FirstName").Value 'Close record set and connection and destroy object references objDBRecordSet.Close() Set objRecordSet = Nothing objDBConnection.Close() Set objDBConnection = Nothing Call Response.Write("Here is your first name: " & Alum.FirstName) 'How do i get my object properties into text boxes? %> When I call reponse.write it works, I just need help getting the info into the html boxes on my page so they can be edited and resubmitted to my Access database. Thanks for any help... Brent

      H Offline
      H Offline
      Horatiu CRISTEA
      wrote on last edited by
      #2

      just set the value atribute of an html control to the value u want it to display for example: <% 'vbscript code Response.Write( "" ) %> or: --------------- Horatiu CRISTEA

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups