将文本框更改为动态页面中的文件上传 [英] change textbox to file upload in dynamic page

查看:74
本文介绍了将文本框更改为动态页面中的文件上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好如何将动态页面中的文本框更改为fileupload,请帮助

hi how can change textbox in dynamic page to fileupload please help

推荐答案

我建​​议您为此使用输入标签.
当您需要将其更改为fileupload时,将输入标签类型属性从文本更改为file

您可能还需要附加文件的帮助
这应该很好

使用SMTP服务器在ASP.NET中发送带有附件的电子邮件 [ ^ ]
I would suggest you to use input tag for this.
when you need to change it to fileupload, change the input tag type attribute from text to file

You might also need help with attaching the file
this should be good

Sending Email with attachment in ASP.NET using SMTP Server[^]


将动态页面中的文本框更改为文件上传
奇怪的要求.您应该已经说明了尝试执行此操作的原因和原因.
除了solution1以外,如果您要这样做

选项1:
在运行时,您可以找到文本框并将其从控件面板中删除.创建一个新的文件上传控件并将其添加到面板中

选项2:
将文本框和文件上传控件同时保留在页面中的所需位置之前.将一个的可见性设置为true,将另一个设置为false.在运行时,只要需要就可以切换控件的可见性.这也将帮助您简化控件的生命周期.

试试吧!
change textbox in dynamic page to fileupload
Strange requirement. You should have explained the scenario on what and why you are trying to do this.

Apart from solution1, if you want to do it then

Option 1:
at runtime, you can find the textbox and remove it from the controls panel. Create a new fileupload control and add it to the panel

Option 2:
Keep both the textbox and file upload control in your page from before at the location needed. Set the visibility of one as true and other as false. At runtime, whenever needed just toggle the visibility of the controls. This will also help you to keep the life cycle of control simple.

Try!


这篇关于将文本框更改为动态页面中的文件上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆