uploadfile asp.net object - how to set the accompanying “mystery” label
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have the following object in my aspx code.
<asp:FileUpload ID="FileUpload1" runat="server"......>
It renders in html like the below image after I browse to a file:
Once I press the "Upload" button to read the file into a base64 encoded string the label text "rabbit2.jpg" dissappears. That mysterious label came with the uploadfile object but there does not seem to be any properties to reset it to Rabbit.jpg or "Rabbit.jpg Uploaded Successfully".
Any ideas?
c# asp.net text label
add a comment |
I have the following object in my aspx code.
<asp:FileUpload ID="FileUpload1" runat="server"......>
It renders in html like the below image after I browse to a file:
Once I press the "Upload" button to read the file into a base64 encoded string the label text "rabbit2.jpg" dissappears. That mysterious label came with the uploadfile object but there does not seem to be any properties to reset it to Rabbit.jpg or "Rabbit.jpg Uploaded Successfully".
Any ideas?
c# asp.net text label
add a comment |
I have the following object in my aspx code.
<asp:FileUpload ID="FileUpload1" runat="server"......>
It renders in html like the below image after I browse to a file:
Once I press the "Upload" button to read the file into a base64 encoded string the label text "rabbit2.jpg" dissappears. That mysterious label came with the uploadfile object but there does not seem to be any properties to reset it to Rabbit.jpg or "Rabbit.jpg Uploaded Successfully".
Any ideas?
c# asp.net text label
I have the following object in my aspx code.
<asp:FileUpload ID="FileUpload1" runat="server"......>
It renders in html like the below image after I browse to a file:
Once I press the "Upload" button to read the file into a base64 encoded string the label text "rabbit2.jpg" dissappears. That mysterious label came with the uploadfile object but there does not seem to be any properties to reset it to Rabbit.jpg or "Rabbit.jpg Uploaded Successfully".
Any ideas?
c# asp.net text label
c# asp.net text label
asked Nov 15 '18 at 15:50
Al WolAl Wol
112
112
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The "mystery" label is done by the browser. It is the filename(s) of the file that has been selected by the user on their local pc. So the properties you want to use in code behind must come from the FileUpload Control.
protected void Button1_Click(object sender, EventArgs e)
if (FileUpload1.HasFile)
Label1.Text = FileUpload1.FileName;
After "Choosing" a file and then viewing the source html I do not see any markup that displays the filename I just chose. Nor do I see "No file chosen" which is the default label that shows up at startup. The problem I am trying to solve is once I press the "upload" button I would like to use that same mystery label to pass the message "rabbit.jpg uploaded successfully". How can I do that? Thank you.
– Al Wol
Nov 16 '18 at 1:05
You cannot. You have to add a Label Control yourself.
– VDWWD
Nov 16 '18 at 7:24
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323134%2fuploadfile-asp-net-object-how-to-set-the-accompanying-mystery-label%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The "mystery" label is done by the browser. It is the filename(s) of the file that has been selected by the user on their local pc. So the properties you want to use in code behind must come from the FileUpload Control.
protected void Button1_Click(object sender, EventArgs e)
if (FileUpload1.HasFile)
Label1.Text = FileUpload1.FileName;
After "Choosing" a file and then viewing the source html I do not see any markup that displays the filename I just chose. Nor do I see "No file chosen" which is the default label that shows up at startup. The problem I am trying to solve is once I press the "upload" button I would like to use that same mystery label to pass the message "rabbit.jpg uploaded successfully". How can I do that? Thank you.
– Al Wol
Nov 16 '18 at 1:05
You cannot. You have to add a Label Control yourself.
– VDWWD
Nov 16 '18 at 7:24
add a comment |
The "mystery" label is done by the browser. It is the filename(s) of the file that has been selected by the user on their local pc. So the properties you want to use in code behind must come from the FileUpload Control.
protected void Button1_Click(object sender, EventArgs e)
if (FileUpload1.HasFile)
Label1.Text = FileUpload1.FileName;
After "Choosing" a file and then viewing the source html I do not see any markup that displays the filename I just chose. Nor do I see "No file chosen" which is the default label that shows up at startup. The problem I am trying to solve is once I press the "upload" button I would like to use that same mystery label to pass the message "rabbit.jpg uploaded successfully". How can I do that? Thank you.
– Al Wol
Nov 16 '18 at 1:05
You cannot. You have to add a Label Control yourself.
– VDWWD
Nov 16 '18 at 7:24
add a comment |
The "mystery" label is done by the browser. It is the filename(s) of the file that has been selected by the user on their local pc. So the properties you want to use in code behind must come from the FileUpload Control.
protected void Button1_Click(object sender, EventArgs e)
if (FileUpload1.HasFile)
Label1.Text = FileUpload1.FileName;
The "mystery" label is done by the browser. It is the filename(s) of the file that has been selected by the user on their local pc. So the properties you want to use in code behind must come from the FileUpload Control.
protected void Button1_Click(object sender, EventArgs e)
if (FileUpload1.HasFile)
Label1.Text = FileUpload1.FileName;
answered Nov 15 '18 at 17:13
VDWWDVDWWD
25.2k123956
25.2k123956
After "Choosing" a file and then viewing the source html I do not see any markup that displays the filename I just chose. Nor do I see "No file chosen" which is the default label that shows up at startup. The problem I am trying to solve is once I press the "upload" button I would like to use that same mystery label to pass the message "rabbit.jpg uploaded successfully". How can I do that? Thank you.
– Al Wol
Nov 16 '18 at 1:05
You cannot. You have to add a Label Control yourself.
– VDWWD
Nov 16 '18 at 7:24
add a comment |
After "Choosing" a file and then viewing the source html I do not see any markup that displays the filename I just chose. Nor do I see "No file chosen" which is the default label that shows up at startup. The problem I am trying to solve is once I press the "upload" button I would like to use that same mystery label to pass the message "rabbit.jpg uploaded successfully". How can I do that? Thank you.
– Al Wol
Nov 16 '18 at 1:05
You cannot. You have to add a Label Control yourself.
– VDWWD
Nov 16 '18 at 7:24
After "Choosing" a file and then viewing the source html I do not see any markup that displays the filename I just chose. Nor do I see "No file chosen" which is the default label that shows up at startup. The problem I am trying to solve is once I press the "upload" button I would like to use that same mystery label to pass the message "rabbit.jpg uploaded successfully". How can I do that? Thank you.
– Al Wol
Nov 16 '18 at 1:05
After "Choosing" a file and then viewing the source html I do not see any markup that displays the filename I just chose. Nor do I see "No file chosen" which is the default label that shows up at startup. The problem I am trying to solve is once I press the "upload" button I would like to use that same mystery label to pass the message "rabbit.jpg uploaded successfully". How can I do that? Thank you.
– Al Wol
Nov 16 '18 at 1:05
You cannot. You have to add a Label Control yourself.
– VDWWD
Nov 16 '18 at 7:24
You cannot. You have to add a Label Control yourself.
– VDWWD
Nov 16 '18 at 7:24
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323134%2fuploadfile-asp-net-object-how-to-set-the-accompanying-mystery-label%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown