Solved

How to write a simple web app in VS 2010.

Posted on 2012-04-05
5
348 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Code works but I need to redo it and assign values to Model 7 33
VB.net/WinForms: adjust Screen Resolution 6 42
C# HTTP GET method sample code 3 41
C# Single Form 8 28
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
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).

896 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now