Authentication to view PDF

G

Guest

I have the below code which authenticates a user to view a PDF. Username and
Password are submitted through the querystring and then checked server-side.
Upon correct username password, the ASP page will stream the PDF, otherwise,
a sorry message will appear.

<%
Response.ContentType = "application/x-pdf"

Dim strURL

If Request.QueryString("username")="todd" And
Request.QueryString("password")="smith" Then
Response.Redirect "http://intranews/norights.pdf"
Else
Response.Redirect "http://intranews/newpaper1023.pdf"
End If
%>

How would this be coded in ASP.NET (with C# or VB.NET behind code)?

Thank you in advance.

-Jess
 
?

/_\\/-

You might want to pick up a book on ASP.NET or visit one of the many web
sites that cover ASP.NET for help you re-write your own code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top