Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/313.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ASP打开代码隐藏下拉列表_C#_Jquery_Asp.net - Fatal编程技术网

C# ASP打开代码隐藏下拉列表

C# ASP打开代码隐藏下拉列表,c#,jquery,asp.net,C#,Jquery,Asp.net,我有一个下拉列表,将使用..中的示例代码打开。 但是,如果我从代码后面调用相同的函数。 ScriptManager.RegisterStartupScript(this,this.GetType(),“”,“运行此(下拉菜单);”,true) 下拉列表不一致,有时会打开,但更多情况下会失败。 是否可以在代码中更改任何内容以使函数调用更可靠?在加载窗口后,您需要调用ShowDropdown函数 ScriptManager.RegisterStartupScript(this, this.GetTy

我有一个下拉列表,将使用..中的示例代码打开。 但是,如果我从代码后面调用相同的函数。
ScriptManager.RegisterStartupScript(this,this.GetType(),“”,“运行此(下拉菜单);”,true)

下拉列表不一致,有时会打开,但更多情况下会失败。
是否可以在代码中更改任何内容以使函数调用更可靠?

在加载窗口后,您需要调用
ShowDropdown
函数

ScriptManager.RegisterStartupScript(this, this.GetType(), "","window.onload = function(){ showDropdown(document.getElementById('dropdown'));}", true);

将其更改为RegisterClientScriptBlock。您所说的是一个代码隐藏-这肯定是asp.net而不是经典的asp.net抱歉,John,刚刚编辑了它。