Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to add Response.Write line in ASP?

Posted on 2011-09-16
5
Medium Priority
?
439 Views
Last Modified: 2012-05-12
Dear EE experts,

I'm not sure for the title of my thread on how to ask it. But I would like to ask for tech support on how to add this Response.Write line in ASP...

Please see the attached screenshots & codes,
The first image is the screenshot of before user logins & inside of that page, the first code is included...

What I want to happen is to add a link (that is hidden if user hasn't login yet, and will show if the user login = true), on the right column beside the "REGISTERED USERS".

I tried to put & use the 2nd code on that space, but it gives me a 500 Internal Server error... and everytime I remove that code, it returns to it's normal state...

This hidden link will be shown when the user logs in & if the user clicks it, it'll redirect the user to the upload page, so I need to put the it's path location as well...

That would be all & hope to hear soon...
* First code:
------------------------
<%
   '// If user is logged in show name and logout link
   If Session("loggedin") = true Then
      Response.Write "Welcome: " & Session("name")
      Response.Write "<br /><a href=""../asia/login2/logout.asp"">Logout</a>"
   Else
      Response.Write "<a href=""ste-iphoto-login.asp"" title=""CLICK TO LOGIN"">REGISTERED USERS</a>"
   End If
%>
----------------------------------
2nd code:
<%
   If Session("loggedIn") = true Then
   Response.Write "<a href=""" & rsProducts("iDownload") & """>DOWNLOAD</a>"
   End If
%>

Open in new window

1st-img.jpg
after-login.jpg
0
Comment
Question by:Stiebel Eltron
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 36550719
Where are you setting: rsProducts("iDownload")?
0
 

Author Comment

by:Stiebel Eltron
ID: 36550791
It is connected to a db. But how if I will change that "rsProducts("iDownload")" by a link that will direct a user to the Upload Page, another page... That will only show the link "UPLOAD" if the user logs in...
0
 
LVL 28

Accepted Solution

by:
strickdd earned 2000 total points
ID: 36550860
I would recommend finding what part of that code is causing the 500 error. Easiest way is to remove everything and slowly add it back in until the error occurs:

Step 1:
<%
   If Session("loggedIn") = true Then
   'nothing
   End If
%>

Step 2:
<%
   If Session("loggedIn") = true Then
   Response.Write "Test"
   End If
%>

Step 3:
<%
   If Session("loggedIn") = true Then
   Response.Write "<a href="""">DOWNLOAD</a>"
   End If
%>

Step 4:
<%
   If Session("loggedIn") = true Then
   Response.Write "<a href=""" & Session("loggedIn") & """>DOWNLOAD</a>"
   End If
%>

If any of these steps fail, we need to figure out why. If none of them fail, then the problem is using the rsProducts object.
0
 

Author Comment

by:Stiebel Eltron
ID: 36558092
Everything works! Great!

I just add the link here:
<%
   If Session("loggedIn") = true Then
   Response.Write "<a href=""http://"">UPLOAD</a>"
   End If
%>

It's working so it means that I did correct :-)
0
 

Author Closing Comment

by:Stiebel Eltron
ID: 36558094
Excellent!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question