Solved

How to write a simple web app in VS 2010.

Posted on 2012-04-05
5
350 Views
Last Modified: 2012-04-16
Hello,

I am a beginner with C# and visual studio 2010.

I want to write a web application that handles a http request, looks in the query fields for a document id, loads the relevent document from a database as a PDF, and return the PDF in the HTTP Response.

Quite simple, and i already have an example running in Delphi as an ISAPI dll.

What coding template do i use in VS 2012?
0
Comment
Question by:soozh
5 Comments
 
LVL 21

Accepted Solution

by:
masterpass earned 500 total points
ID: 37814368
this should get you started

http://www.mikesdotnetting.com/Article/80/Create-PDFs-in-ASP.NET-getting-started-with-iTextSharp

The point is that when you want to make good PDF's you should rely on third party tools. Another tool to be looked at is activePDF

for getting started in asp.net application, you should be looking as MSDN! an example simple application is here : http://www.kirupa.com/net/helloWorld.htm

hope this helps!
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37815405
It sounds more like you already have a PDF document in a BLOB field, so you wouldn't need iTextSharp.  As far as template goes, it would be my suggestion to use File > New > Project > Visual C# > Web > ASP.NET Empty Web Application.
0
 
LVL 22

Expert Comment

by:ambience
ID: 37815589
The fact that you had an ISAPI dll earlier makes me want to suggest that you also look into the options of not having a web-app but a Webservice for that purpose. The idea is explained here

http://www.dotnetcurry.com/ShowArticle.aspx?ID=723

IT should be easy to add missing code for database access.
0
 

Author Comment

by:soozh
ID: 37815811
Hello,

Thanks for the comments...

Yes i already have the PDF so i dont need to generate that.

What i am looking at is returning the PDF in the HTTP response.  Can a web service do this?

And can i pass login credentials in the content fields?  The whole thing will run under https.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37815816
A web service could return the PDF as a byte array, and the caller could use that byte array to recreate the PDF in whatever manner was required.

A web site could return the PDF in the HTTP response.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
insert value of checklistbox checked 4 32
Can't disable touch pad on Windows 10 computer 16 45
Convert Ctime to date time in textfile? 7 28
VS 2017 18 30
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

792 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