473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Where to place <div>s in ASP script?

Hello

I am unsure where to place a <div></div> in my ASP script. I am trying to achieve something like the box that shows uploaded files in the attached screenshot.

The CSS I have is this:
Expand|Select|Wrap|Line Numbers
  1. .solidBlue
  2.  
  3. {
  4.  
  5. border-style:solid; 
  6. border-color:#E2EFF8;
  7. border-width:thin;
  8. margin:15px; 
  9. width:150px; 
  10. padding:10px;
  11.  
  12. }
so my ASP code would need to be surrounded by

<div class="solidBlue">ASP script here</div>

The relevant ASP is this:

Expand|Select|Wrap|Line Numbers
  1. function SaveFiles
  2.     Dim Upload, fileName, fileSize, ks, i, fileKey
  3.  
  4. Set Upload = New FreeASPUpload
  5.  
  6.     Upload.Save(uploadsDirVar)
  7.  
  8.     ' If something fails inside the script, but the exception is handled
  9.     If Err.Number<>0 then Exit function
  10.  
  11.     SaveFiles = ""
  12.     ks = Upload.UploadedFiles.keys
  13.     if (UBound(ks) <> -1) then
  14.  
  15.  
  16.         SaveFiles = "<h4 class=""head"">Files uploaded:</h4> "
  17.         for each fileKey in Upload.UploadedFiles.keys
  18.  
  19.  
  20. SaveFiles = SaveFiles & "<p class=""head1"">" & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & " B)</p>"
  21.  
  22.         next
  23.     else
  24.         SaveFiles = "No file selected for upload or the file name specified in the upload form does not correspond to a valid file in the system."
  25.     end if
  26.     'SaveFiles = SaveFiles & "<br><p class=""head2"">Enter a number = " & Upload.Form("enter_a_number") & "</p>"
  27.     'SaveFiles = SaveFiles & "<p class=""head3"">Checkbox values = " & Upload.Form("checkbox_values") & "</p>"
  28.     'SaveFiles = SaveFiles & "<p class=""head4"">List values = " & Upload.Form("list_values") & "</p>"
  29.     'SaveFiles = SaveFiles & "<p class=""head5"">Text area = " & Upload.Form("t_area") & "</p>"
  30.  
  31. end function
  32. %>
Thank you for any advice.

Blue
Attached Images
File Type: jpg filesUploaded.jpg (83.6 KB, 160 views)
May 1 '14 #1

✓ answered by Luk3r

I'm no expert in ASP.NET but I believe you actually have to generate your HTML code then add your <div>'s code within the HTML around the section that you want the border to appear.

4 1329
Luk3r
300 256MB
I'm no expert in ASP.NET but I believe you actually have to generate your HTML code then add your <div>'s code within the HTML around the section that you want the border to appear.
May 1 '14 #2
jhardman
3,406 Expert 2GB
Luk3r, please don't confuse me, we are talking ASP, not ASP.net :)

Bluenose, this is easy. the function can be anywhere, for ease of reference, put it on the top of the page. write the divs like this:
Expand|Select|Wrap|Line Numbers
  1. <div><%=SaveFiles%></div>
when the script executes it doesn't do anything when it reads the function definition. But when it gets to the div it executes the function and puts the result right there. does this make sense?

Jared
May 1 '14 #3
Luk3r
300 256MB
OOPS! I confused myself too, apparently. My apologies.
May 1 '14 #4
jhardman
3,406 Expert 2GB
you could also write it
Expand|Select|Wrap|Line Numbers
  1. <div><%
  2. response.write SaveFiles
  3. %></div>
but the result is the same.

Let me know if this helps.

Jared
May 1 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: squash | last post by:
Where do you go to advertise a php script you wrote and want to sell? There are many "script" sites out there but I am wasting a lot of time trying to figure out the legitimate ones from the link...
11
by: Konrad Den Ende | last post by:
I have a script placed somewhere in the body of my HTML-doc. I noticed that i'll be using the very same script in a large number of document (all of them as the script regards the time of the most...
6
by: Sentinel | last post by:
how can i place a script in body (it must be ran automaticly when html interpreter reaches it) that will redirect to another page? what i am doing is checking in php if login is successful...
3
by: pamelafluente | last post by:
Hi I have seen on some web pages a nice type of tooltip. See for instance http://www.programurl.com/software/tooltip.htm and mouse over on Javascript (first box left). Can anyone point me or...
10
by: mark4asp | last post by:
I ask this because only today I read advice telling me to put it within the <headelement. This is the same advice I've always been given but no one ever explained why. Last week I was told to...
2
by: SMH | last post by:
I am in the process of converting all HTML documents, including many dynamic/interactive documents, to XHTML documents (because I want to incorporate SVG and MathML, among other things). I am...
2
by: kj | last post by:
Hi! I have a Pythonoob question. I have a script that hangs indefinitely at random times; the only thing to do at this point is to kill it. I'm looking for suggestions on how to troubleshoot...
0
by: PPURUSHOTTAM | last post by:
Sir please tell me where place my ms access (ado) database in my website project for hosting . Lacally my websit run but globally have create some problem .
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.