How do I add assembly reference using ASP.NET Web Matrix???

Posted on 2006-04-20
Last Modified: 2012-08-14
I'm making web system with ASP.NET Web Matrix with C#.
I want to use System.Windows.Forms in order to use OpenFileDalog and I got following error....

Compiler Error Message: CS0234: The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)

Source Error:

Line 3:  <%@ import Namespace="System.Data.SqlClient" %>
Line 4:  <%@ import Namespace="System.Web" %>
Line 5:  <%@ import Namespace="System.Windows.Forms" %>

I don't know how to add reference...Please somebody help with detail answer how to add assembly reference to Web Matrix!
Question by:manamioba
    LVL 23

    Expert Comment

    You won't be able to use OpenFileDialog anyways in web application. Calling it would simply invoke the action on server and not on client.

    Author Comment

    Thank you for your response naveenkohli.
    Do you have any idea what I can use instead of OpenFileDialog to let user select a file from dialog box and get its directory path?

    Author Comment

    My purpose is not to upload, downlod files on server.
    I want to open a dialog box and let user choose a file, get its directory path, and save it to a database.
    So when the user visit my site next time, they can open the file they choosed last time by getting directory from the database.
    LVL 23

    Accepted Solution

    You will need to use HtmlInputFile control which displays standard file selection dialog box.
    You can't sniff paths on client side without help of an activex control installed on machine or some other external mechanism. HtmlInputFile control will get you name of the file (probably path.. but not certain all the time) and content of that file.
    See the documentation for this control to see how it is used.

    Author Comment

    I see.
    I will try HtmlInputFile.
    Thank you very much for your help!

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video discusses moving either the default database or any database to a new volume.

    729 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

    23 Experts available now in Live!

    Get 1:1 Help Now