StartupScript 问题 試試document.all('DropDownList1').selectedIndex = -1->document.all.DropDownList1.selectedIndex = -1 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的DropDownList1到客户端后id未必仍然是DropDownList1,asp.net会根据情况改变的,要获得客户端id,应该用DropDownList1.ClientID,另外你的javascript脚本也不对,不能用document.all('DropDownList1')而应该用document.all['DropDownList1']或者document.all.DropDownList1。 上面的script是一个大虾提供的,去掉()效果看上去好象一样。页面上有三个dropdownlist,有不同的button 都用到他们,click 来click 去,几下就不行了。还有没有办法?webdiyer说的clientID 具体怎么用? 用法如下,假设你的DropDownList的ID是mydropdownlist:DropDownList1.databind()string scriptString= "<script language='javascript'>document.all[\'"+mydropdownlist.ClientID+"\'].selectedIndex = -1;</" + "script>"RegisterStartupScript("Startup", scriptString) 如果你在page指令里设置了SmartNavigation="true":<%@ Page language="c#" Codebehind="sfgl_item.aspx.cs" AutoEventWireup="false" Inherits="wjj.sfgl" SmartNavigation="true"%>那么在前几次单击的时候就会出错,后几次就会弹出相同的一个页面及你要打开的页面,你把SmartNavigation="false"就正常了。 还有一个问题是关于“Startup" 这个参数,对于不同的dropdownlist 都作相同的registerStartupScript, 好想如果都用"Startup",只有第一个work, 后面的都不行,是不是得起不同的名字,like "Startup1", "Startup2",...... asp 的mac正则表达式问题 关于Cache问题 请给出真正解决问题的方法,50分! 求救 关于asp.net2.0中的webpart问题 this.dropdowmlist.SelectedIndex = -1是什么意思啊 ★★★★★送分帖:非常简单的一个问题,但没有思路,请大家帮忙!!!!!★★★★★ dataGrid中选择后改变颜色 asp.net如何判断远程是否有指定的文件存在? AjaxControlToolkit.dll在在那里能下载到阿?请各位前辈指教!!!!!!!!!!!! 急:有关窗体的问题 急!在线。高分求助,OCX控件问题。 急,在线等待......
webdiyer说的clientID 具体怎么用?
DropDownList1.databind()
string scriptString= "<script language='javascript'>document.all[\'"+mydropdownlist.ClientID+"\'].selectedIndex = -1;</" + "script>"
RegisterStartupScript("Startup", scriptString)
<%@ Page language="c#" Codebehind="sfgl_item.aspx.cs" AutoEventWireup="false" Inherits="wjj.sfgl" SmartNavigation="true"%>
那么在前几次单击的时候就会出错,后几次就会弹出相同的一个页面及你要打开的页面,你把SmartNavigation="false"就正常了。