如何实现按钮按下的时候,按钮不可用。查询完成,可用。

dljinsui 2006-08-01 08:39:33
想实现功能:

CmdQuery按下的时候,按钮不可用。查询完成,可用。

如何实现?
Private Sub CmdQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdQuery.Click
Dim RefsMsg As String, RefRS As ADODB.Recordset = Nothing
Dim CQuote As New BLL.Quote.CQuote
Dim CDateGrid As New Common.CADOToDOTNET
Dim RefTable As New DataTable
Dim CCommon As New Common.CommonClass
Dim GetDataGridCol() As String = {"quote_num", "stat", "cust_num", "name", "sumprice", "cust_seq", "cust_addr", "contact", "fax_num", "slsman", "slsman_name", "contact_tel", "cust_po", "tax_code", "terms_code", "terms_der", "curr_code", "ship_code", "input_man", "input_man_name", "input_date"}
Dim GetDataGridColDescription() As String = {"报价单号", "状态", "客户编码", "客户名称", "总金额", "发货序", "发货地址", "联系人", "传真", "外勤", "外勤姓名", "电话", "PO号", "税码", "结算代码", "结算描述", "货币码", "发货类型", "内勤", "内勤姓名", "创建时间"}
Dim CSecurity As New BLL.SessionStat
If CSecurity.SessionOutLogin(Me) = True Then Exit Sub
If drpYyNameList.SelectedValue = "" Then
CCommon.MsgBox("不存在营业所!", "drpYyNameList", Me)
Exit Sub
End If
If txtValue.Text.Trim = "" Then
CCommon.MsgBox("查询条件不可为空!", "txtValue", Me)
Exit Sub
End If
Session.Add(BLL.UserInfoConstant.SESSION_USER_INFO_YYCODE, drpYyNameList.SelectedValue)
CQuote.CN = CType(Session(BLL.UserInfoConstant.SESSION_USER_CON_CN), ADODB.Connection)
RefsMsg = CQuote.Query(drpYyNameList.SelectedValue, Sort.SelectedIndex + 1, txtValue.Text.Trim, IIf(ChkMyQuote.Checked, Session(BLL.UserInfoConstant.SESSION_USER_INFO_GONGHAO), ""), 50, True, RefRS)
If RefsMsg <> Nothing Then
CCommon.MsgBox(RefsMsg.Trim.ToString, "txtValue", Me)
Exit Sub
End If
If RefRS.EOF = False Then
RefTable = CDateGrid.RsToDateView(RefRS, GetDataGridCol, GetDataGridColDescription)
dagr_ShowData.DataSource = RefTable.DefaultView
dagr_ShowData.DataBind()
CCommon.TextSetFocus("dagr_ShowData:_ctl2:_ctl0", Me)
Else
CCommon.MsgBox("没有你想查询的数据结果!", "txtValue", Me)
RefRS = Nothing
Exit Sub
End If
RefRS.Close() : RefRS = Nothing
lbl_Count.Text = "共有<FONT color='red'>" + RefTable.DefaultView.Count.ToString() + "</FONT>条记录"
End Sub
...全文
191 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
songzx66 2006-08-01
  • 打赏
  • 举报
回复
要用到前台的js脚本,提交查询时执行button里onclick脚本。
dljinsui 2006-08-01
  • 打赏
  • 举报
回复
Private Sub CmdQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdQuery.Click

CmdQuery.enabled = false

执行操作 ...

CmdQuery.enabled = true

End Sub

==========================
不行哎,不好用。
WAWQ 2006-08-01
  • 打赏
  • 举报
回复

CmdQuery.enabled = false

执行操作 ...

CmdQuery.enabled = true
hz890 2006-08-01
  • 打赏
  • 举报
回复
可以考虑在form元素的onsubmit事件中处理:
<script>
function fn()
{
document.all("Button2").disabled=true;
alert("aaa");
document.all("Button2").disabled=false;
}
</script>
<form id="Form1" method="post" runat="server" onsubmit="fn();">
<asp:Button id="Button2" style="Z-INDEX: 102; LEFT: 552px; POSITION: absolute; TOP: 208px" runat="server" Text="确定" EnableViewState="False"></asp:Button>
</form>
wlb854 2006-08-01
  • 打赏
  • 举报
回复
留个脚印。。。。
dljinsui 2006-08-01
  • 打赏
  • 举报
回复
要用到前台的js脚本,提交查询时执行button里onclick脚本。



帮忙给个例子。

62,073

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧