重置文本框字段和组合框asp.net/vb.net [英] Reset a textbox field and combo box asp.net/vb.net

查看:154
本文介绍了重置文本框字段和组合框asp.net/vb.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我很抱歉,如果我的英语非常糟糕,那么无论如何要取消它

我有一个带有文本框和按钮的网络应用程序,下载超文本



我所做的是创建一个可以处理下载excel文件的类



这是函数从网络服务器下载我的excel文件

Hi I''m very sorry if my english is so bad just neglict it anyway
I have a web app which have a textbox and a button, that download excelfiles

what I did is I create a class that will handle in downloading the excel files

this is the function that download my excel files from the webserver

HttpContext.Current.Response.ContentType = "Application/xmsexcel"
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" & textbox1.text &".xls")            HttpContext.Current.Response.TransmitFile(Server.MapPath("~\Bin\toExcel.xls"))







我的问题是如何重置asp上的文本框值我下载了excel文件后的.net






我试过回复。重定向但发生的事情是它没有下载文件,尝试使用javascript但我仍然没有得到最好的解决方案



希望有人可以帮助我使用此:):




my question is how can I reset the textbox value on my asp.net after I''ve downloaded the excel files



I''ve try Response.redirect but what happen is it didn''t download the files, try using a javascript but I still don''t get the best solution

hope someone can help me with this :)

推荐答案

在任何想要清除文本框值的位置设置textbox1.text = string.empty。
Set textbox1.text=string.empty wherever you want to clear the textbox value.


I认为重置文本框的唯一方法是使用javascript

I think the only way to reset a textbox is to use a javascript
document.getElementById("<%= TextBox1.ClientID %>").value = "";


这篇关于重置文本框字段和组合框asp.net/vb.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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