I.T. Discussion Community!
-Collapse +Expand
Coder
Search Coder Group:

Advanced
-Collapse +Expand Coder Study Test
PRESTWOODCERTIFIED
-Collapse +Expand Coder Store
PRESTWOODSTORE

Prestwood eMagazine

January Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyCoding & OO BoardGeneral .Net Concepts Topic   Print This     

Please Read - .aspx website with .asp code in it.

Please Read - .aspx website with .asp code in it. in General .Net Concepts topic (part of our Coding & OO group).

Quick Search: website   Read   Read aspx   website asp   code it  
S0nY
Baton Rouge, LA USA
Rank: Ensign
My entire website is written in .aspx, i have a voting poll that a friend made for me that was written in .asp, I have been trying to research on the internet on how exactly to get my .asp voting poll on my .aspx site. Do any of you .aspx gurus out there know a site with information that could help me get started in the right direction on how i can get this working correctly? Any help is appreciated, thank you very much.
 Posted 12 years ago (Thread Starter)
Comment Quote
About S0nY -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #12358, 6 reply
Thread Started 12/17/2007 11:41:39 AM
View Counter=7953
Last Reply Posted 1/4/2018 2:27:15 AM)
Location=Baton Rouge, LA USA 
Joined=12 years ago   MB Posts=53  
Moderator
Mike Prestwood
Prestwood IT
Prestwood IT office in Citrus Heights, CA
Rank: Fleet Admiral

I assume you mean you want to share something between your ASP and ASPX pages. Is that true? If so, an easy way is for both your ASP and ASPX pages to use the same database. You could also read and write cookies too. Session variables are a bit more complicated and you can't share them directly.

Does that help?

--
Mike Prestwood
Prestwood IT Solutions

 Posted 12 years ago
Comment Quote
About Mike Prestwood -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Mike Prestwood

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Web Presence
Facebook, Prestwood IT Facebook page -- fan page. (Visit Me)
Twitter, Follow Prestwood IT on Twitter. (Visit Me)
LinkedIn, Prestwood IT company page on LinkedIn. (Visit Me)
YouTube, Prestwood IT YouTube Channel (Visit My Channel)
Website, My drum website where I sell my drum books. (http://www.play-drums.com)

Post ID #12366 (Level 1.1)  Reply to 12358
Thread Started 12/19/2007 12:17:28 AM
View Counter=2
Location=Prestwood IT office in Citrus Heights, CA 
Joined=19 years ago   MB Posts=1410   KB Posts=1805   KB Comments=76   BLOG, Topics=4  
S0nY
Baton Rouge, LA USA
Rank: Ensign

Thanks for the post Mike. I understand what you are speaking of, but that is not my problem, my problem is more simple than that. Basically i have a webpage that is in .aspx format,  in the body of my aspx page i am trying to run this code " <!--#include file='dcb/poll.asp' --> " which is an asp command and when i try to run the webpage with this command inserted in the body i get an error:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30807: 'Let' and 'Set' assignment statements are no longer supported.

Source Error:

Line 45: ' * * * * * * * * * * *  
Line 46: Dim CN  
Line 47: Set CN = Server.CreateObject("ADODB.Connection")  
Line 48: CN.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;" & _  
Line 49: "Data Source=" & Path & "Poll.mdb" & ";" & _ 

The poll.ap file it is trying to run is this ill show you the code:

 <!--#include file='adovbs.inc'-->
<%
' * * * * * * * * * * * *
' * Display Poll Number *
' * * * * * * * * * * * *
Dim Poll
Poll = "2"

' * * * * * * * * * * * * * * * * * * *
' *          Database Structure       *
' * * * * * * * * * * * * * * * * * * *
'Database:   Poll.mdb
'
'Table:     tblPoll
'Fields:     rcrd_ID   (AutoNuMber)(Key)
'            Poll_Nr   (Text 50)
'            Poll_Date (Date)
'            Question  (Text 255)
'            Option1   (Text 50)
'            Option2   (Text 50)
'            Option3   (Text 50)
'            Option4   (Text 50)
'            Option5   (Text 50)
'            Option6   (Text 50)
'
'Table:     tblVote
'Fields:     rcrd_ID   (AutoNuMber)(Key)
'            Poll_Nr   (Text 50)
'            zDate     (Date)
'            Vote      (Text 1)
'            IP        (Text 16)
'
' * * * * * * * * * * * * * * * * * * *
' * My five line Path/FileName finder *
' * * * * * * * * * * * * * * * * * * *
Dim Path, A, FileName
Path = Request.ServerVariables("PATH_TRANSLATED")
A = Split(Path, "\")
FileName = A(UBound(A))
Path = left(Path,Len(Path)-Len(FileName))


' * * * * * * * * * * *
' * Open the Database *
' * * * * * * * * * * *
Dim CN
Set CN = Server.CreateObject("ADODB.Connection")
CN.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Path & "Poll.mdb" & ";" & _
"Persist Security Info=False;"
CN.Open


' * * * * * * * * * * * *
' * Open the Recordset  *
' * * * * * * * * * * * *
Dim RS, R2, SQL
Set RS = Server.CreateObject("ADODB.Recordset")
Set RS.ActiveConnection = CN
RS.CursorType = adOpenStatic
RS.LockType = adLockOptimistic

Set R2 = Server.CreateObject("ADODB.Recordset")
Set R2.ActiveConnection = CN
R2.CursorType = adOpenStatic
R2.LockType = adLockOptimistic

' * * * * * * * *
' * Record Vote *
' * * * * * * * *
If Len(Request("Option")) > 0 Then
   Dim IP, Total, Opt
   IP = Request.ServerVariables("REMOTE_ADDR")
   If IP <> "127.0.0.1" Then
      SQL = "Select * From [tblVote] "
      SQL = SQL & "Where [IP] = '" & IP & "' "
      SQL = SQL & "And [Poll_Nr] = '" & Poll & "' "
      RS.Open SQL
      If RS.EOF Then
         RS.Close
         SQL = "Select * From [tblVote] "
         RS.Open SQL
         RS.AddNew
         RS("Poll_Nr") = Request("Poll_Nr")
         RS("zDate") = Date
         RS("Vote") = Request("Option")
         RS("IP") = IP
         RS.Update
      End If
   Else
      SQL = "Select * From [tblVote] "
      RS.Open SQL
      RS.AddNew
      RS("Poll_Nr") = Request("Poll_Nr")
      RS("zDate") = Date
      RS("Vote") = Request("Option")
      RS("IP") = IP
      RS.Update
   End If
   RS.Close
   SQL = "Select Count([Vote]) as myCount From [tblVote] "
   SQL = SQL & "Where [Poll_Nr] = '" & Request("Poll_Nr") & "' "
   R2.Open SQL
   Total = R2("myCount")
   R2.Close
   Response.Write "<div style='border:1px solid black;padding:6px;background-color:#DDF5FF;'>"
   SQL = "Select * From [tblPoll] "
   SQL = SQL & "Where [Poll_Nr] = '" & Request("Poll_Nr") & "' "
   RS.Open SQL
   Response.Write RS("Question")
   Response.Write "<blockquote>"
   Response.Write "<table style='margin:0;border:0;padding:0;'>"
   SQL = "Select Count([Vote]) as myCount,[Vote] From [tblVote] "
   SQL = SQL & "Where [Poll_Nr] = '" & Request("Poll_Nr") & "' "
   If IP <> "127.0.0.1" Then
      SQL = SQL & "And [IP] <> '127.0.0.1' "
   End If
   SQL = SQL & "Group by [Vote] "
   R2.Open SQL
   Do Until R2.EOF
      Opt = "Option" & R2("Vote")
      Response.Write "<tr>"
      Response.Write "  <td>" & RS(Opt) & "   </td>"
      Response.Write "  <td align='right'>   " & R2("myCount") & "</td>"
      Response.Write "  <td align='right'>   "
      Response.Write FormatPercent((R2("myCount")/Total)) & "   </td>"
      Response.Write "<tr>"
      R2.MoveNext
   Loop
   Response.Write "</table>"
   Response.Write "</blockquote>"
   RS.Close
   Response.Write "Thank you for voting."
   Response.Write "<br><br>"
   Response.Write "</div>"
   Response.End
End If


SQL = "Select * From [tblPoll]"
SQL = SQL & "Where [Poll_Nr] = '" & Poll & "' "
RS.Open SQL

Response.Write "<div style='border:1px solid black;padding:6px;background-color:#DDF5FF;'>"
Response.Write RS("Question")
Response.Write "<blockquote>"

Response.Write "<form method='post' action='" & FileName & "'>"
Response.Write "<input type='hidden' name='Poll_Nr' value='" & RS("Poll_Nr") & "'>"
  
   Response.Write "<label for='Option1'>"
   Response.Write "<input type='radio' name='Option' value='1' ID='Option1'>" & RS("Option1")
   Response.Write "</label>"
   Response.Write "<br>"
   Response.Write "<label for='Option2'>"
   Response.Write "<input type='radio' name='Option' value='2' ID='Option2'>" & RS("Option2")
   Response.Write "</label>"
   Response.Write "<br>"
   If Len(RS("Option3")) > 0 Then
      Response.Write "<label for='Option3'>"
      Response.Write "<input type='radio' name='Option' value='3' ID='Option3'>" & RS("Option3")
      Response.Write "</label>"
      Response.Write "<br>"
   End If
   If Len(RS("Option4")) > 0 Then
      Response.Write "<label for='Option4'>"
      Response.Write "<input type='radio' name='Option' value='4' ID='Option4'>" & RS("Option4")
      Response.Write "</label>"
      Response.Write "<br>"
   End If
   If Len(RS("Option5")) > 0 Then
      Response.Write "<label for='Option5'>"
      Response.Write "<input type='radio' name='Option' value='5' ID='Option5'>" & RS("Option5")
      Response.Write "</label>"
      Response.Write "<br>"
   End If
   If Len(RS("Option6")) > 0 Then
      Response.Write "<label for='Option6'>"
      Response.Write "<input type='radio' name='Option' value='6' ID='Option6'>" & RS("Option6")
      Response.Write "</label>"
      Response.Write "<br>"
   End If

Response.Write "</blockquote>"
Response.Write "<input type='submit' value=' Vote '>"
Response.Write "</form>"
Response.Write "</div>"
%>

 Am i totally out of luck to get this working with my .apsx page? Is there not another way to call upon my poll.asp?

 Posted 12 years ago (Thread Starter)
Comment Quote
About S0nY -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #12367 (Level 1.2)  Reply to 12358
Reply Posted 12/19/2007 10:59:34 AM
Last Updated 6/24/2008 1:17:52 PM
Location=Baton Rouge, LA USA 
Joined=12 years ago   MB Posts=53  
S0nY
Baton Rouge, LA USA
Rank: Ensign

I do apologize if i did not clearly explain myself correctly. I do not know very much with asp or asp.net, i am trying very hard daily to learn, i mainly program with paradox for the time being, i dont work with websites to often.

My question is somewhat simple, i have a webpage that is in .aspx format, on that page i was wanting to have a voting poll appear on the page, for just asking our customers certain questions just to get their opinions on certain things. The voting poll itself was created with .asp, my question is: Is there a way or a command i can type in the "body" of my .aspx page that will actually make my .asp poll show up on my .aspx website..

Above this message I posted the .asp poll code that i have.

The command i am typing in the "body" of my .aspx page to make the poll appear on my .aspx page is this: " <!--#include file='dcb/poll.asp' --> "  but if i am not mistake this command is a .asp command. Is there a .aspx command that will, let's say " call " upon my .asp poll i made and make it appear on my .aspx website ?

Example:

Website here - (.aspx page)

Voting Poll Code - here (.asp)

Want to get the "Voting Poll" to appear on the "Main Page" of my .aspx page.

Sorry for posting again, I just wanted to make sure i wrote out my question a bit better. Thank you Mike and all else reading. 

 Posted 12 years ago (Thread Starter)
Comment Quote
About S0nY -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #12368 (Level 1.3)  Reply to 12358
Reply Posted 12/20/2007 3:33:18 PM
Location=Baton Rouge, LA USA 
Joined=12 years ago   MB Posts=53  
S0nY
Baton Rouge, LA USA
Rank: Ensign

Thank you very much ASPguy, i hope you think of something that i wasnt able to think of.

If you are unable to think of a way to get this working, do you or  anyone else have any suggestions for me to get a poll on my .aspx website ? Maybe theres a developer tool out there that has a good poll that comes with it, or maybe some good voting software that is compatible with .aspx?

Any suggestions would be appreciated, thank you very much everyone.

 Posted 12 years ago (Thread Starter)
Comment Quote
About S0nY -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #12381 (Level 1.4)  Reply to 12358
Reply Posted 12/26/2007 4:01:37 PM
Location=Baton Rouge, LA USA 
Joined=12 years ago   MB Posts=53  
ASPGuy
San Francisco, CA USA
Rank: Ensign
i don't think you can. I'll fire up my vs.net 2003 and see if it's possible but i don't think so cuz they approach serving pages differently

--

Andy

 Posted 12 years ago
Comment Quote
About ASPGuy -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About ASPGuy

I work for a large company in SF. I spend my days mostly doing analysis but code in asp and vb.net whenever possible.


Post ID #12370 (Level 1.5)  Reply to 12358
Reply Posted 12/22/2007 4:22:40 PM
Location=San Francisco, CA USA 
Joined=12 years ago   MB Posts=48   KB Comments=5  
Most Recent Post
PS_661
-- --
Rank: Cadet 1st Year

Well, inning accordance with me there is second Cheat Engine Download APK for Android | 2017 Latest v6.5.2 Cheat Engine Apk finish every one of your dream.

 Posted 12 months ago
Comment Quote
About PS_661 -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread with a verified email.
Member pending approval.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #16959 (Level 2) and Parent is 12358
Reply Posted 1/4/2018 2:26:52 AM
Location=-- -- 
Joined=12 months ago   MB Posts=3  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1164A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #12358 Counter
7953
Since 4/2/2008
-
   Contact Us!
 
PrestwoodBoards.com was developed and is maintainted by me. Do you have a question or suggestion? Do you see a problem? Contact me now. My goal is to build an ad-free and spam-free source of I.T. information with many contributers (ok to promote your website/company in your bio). Yes, my company Prestwood IT Solutions is mentioned in my bio which shows with every post, but you can contribute and promote your pet project too!

1,999 People Online Now!!  
Sign In to see who's online now!  Not a member? Join now. It's free!
Show more stats...


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech