Click here to Skip to main content
15,917,062 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Google map with multiple marked location Pin
ZurdoDev3-Jun-16 4:40
professionalZurdoDev3-Jun-16 4:40 
QuestionHttpWebRequest authentication problem Pin
candogu2-Jun-16 3:07
candogu2-Jun-16 3:07 
AnswerRe: HttpWebRequest authentication problem Pin
ZurdoDev2-Jun-16 3:14
professionalZurdoDev2-Jun-16 3:14 
GeneralRe: HttpWebRequest authentication problem Pin
candogu2-Jun-16 3:16
candogu2-Jun-16 3:16 
GeneralRe: HttpWebRequest authentication problem Pin
ZurdoDev2-Jun-16 3:19
professionalZurdoDev2-Jun-16 3:19 
AnswerRe: HttpWebRequest authentication problem Pin
John C Rayan2-Jun-16 3:18
professionalJohn C Rayan2-Jun-16 3:18 
AnswerRe: HttpWebRequest authentication problem Pin
F-ES Sitecore2-Jun-16 4:24
professionalF-ES Sitecore2-Jun-16 4:24 
QuestionAsp.Net MVC View, Loading HTML in iframe element instead of src=url Pin
jkirkerx1-Jun-16 11:25
professionaljkirkerx1-Jun-16 11:25 
AnswerRe: Asp.Net MVC View, Loading HTML in iframe element instead of src=url Pin
Richard Deeming2-Jun-16 2:21
mveRichard Deeming2-Jun-16 2:21 
GeneralRe: Asp.Net MVC View, Loading HTML in iframe element instead of src=url Pin
jkirkerx2-Jun-16 6:36
professionaljkirkerx2-Jun-16 6:36 
GeneralRe: Asp.Net MVC View, Loading HTML in iframe element instead of src=url Pin
jkirkerx2-Jun-16 8:26
professionaljkirkerx2-Jun-16 8:26 
GeneralRe: Asp.Net MVC View, Loading HTML in iframe element instead of src=url Pin
Richard Deeming2-Jun-16 8:37
mveRichard Deeming2-Jun-16 8:37 
GeneralRe: Asp.Net MVC View, Loading HTML in iframe element instead of src=url Pin
jkirkerx2-Jun-16 9:32
professionaljkirkerx2-Jun-16 9:32 
QuestionHelp with fileupload object Pin
turbosupramk31-Jun-16 6:03
turbosupramk31-Jun-16 6:03 
AnswerRe: Help with fileupload object Pin
Richard Deeming1-Jun-16 6:55
mveRichard Deeming1-Jun-16 6:55 
GeneralRe: Help with fileupload object Pin
turbosupramk31-Jun-16 7:39
turbosupramk31-Jun-16 7:39 
Thanks for the reply. I have something similar to that and for discussion and testings sake I am now using the code from the first link.

My question is, when I choose a file in the fileupload box, how can I trigger an event? Do I use event handlers like with c# or can I use a worker thread in the background to monitor if fileUpload1.HasFile is true or not?



ASP.NET
C#

<%@ Page Language="C#" %>

<script runat="server">
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile)
            try
            {
                FileUpload1.SaveAs("C:\\Uploads\\" + 
                     FileUpload1.FileName);
                Label1.Text = "File name: " +
                     FileUpload1.PostedFile.FileName + "<br>" +
                     FileUpload1.PostedFile.ContentLength + " kb<br>" +
                     "Content type: " +
                     FileUpload1.PostedFile.ContentType;
            }
            catch (Exception ex)
            {
                Label1.Text = "ERROR: " + ex.Message.ToString();
            }
        else
        {
            Label1.Text = "You have not specified a file.";
        }
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Upload Files</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:FileUpload ID="FileUpload1" runat="server" /><br />
        <br />
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" 
         Text="Upload File" />&nbsp;<br />
        <br />
        <asp:Label ID="Label1" runat="server"></asp:Label></div>
    </form>
</body>
</html>

GeneralRe: Help with fileupload object Pin
Richard Deeming1-Jun-16 7:52
mveRichard Deeming1-Jun-16 7:52 
GeneralRe: Help with fileupload object Pin
turbosupramk31-Jun-16 8:07
turbosupramk31-Jun-16 8:07 
GeneralRe: Help with fileupload object Pin
Richard Deeming1-Jun-16 8:16
mveRichard Deeming1-Jun-16 8:16 
GeneralRe: Help with fileupload object Pin
turbosupramk31-Jun-16 9:21
turbosupramk31-Jun-16 9:21 
GeneralRe: Help with fileupload object Pin
Richard Deeming2-Jun-16 1:46
mveRichard Deeming2-Jun-16 1:46 
GeneralRe: Help with fileupload object Pin
turbosupramk32-Jun-16 2:43
turbosupramk32-Jun-16 2:43 
GeneralRe: Help with fileupload object Pin
Richard Deeming2-Jun-16 2:45
mveRichard Deeming2-Jun-16 2:45 
GeneralRe: Help with fileupload object Pin
turbosupramk32-Jun-16 4:00
turbosupramk32-Jun-16 4:00 
GeneralRe: Help with fileupload object Pin
Richard Deeming2-Jun-16 4:24
mveRichard Deeming2-Jun-16 4:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.