Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.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
使用Google地图动态添加ASP.Net用户控件_Asp.net_Google Maps_User Controls - Fatal编程技术网

使用Google地图动态添加ASP.Net用户控件

使用Google地图动态添加ASP.Net用户控件,asp.net,google-maps,user-controls,Asp.net,Google Maps,User Controls,İ下载了gMap.dll并创建了一个包含Map的userControl。当我在aspx页面中直接使用这个userControl时,没有问题。但是当我将这个userControl动态插入页面时,它只会给出一个灰色框。这是我的动态添加代码 Control userControl=LoadControl(“kcfinder/upload/userControl/googleMap.ascx”); userControlDiv.Controls.Add(userControl) 那么,有些组件没有使用此

İ下载了gMap.dll并创建了一个包含Map的userControl。当我在aspx页面中直接使用这个userControl时,没有问题。但是当我将这个userControl动态插入页面时,它只会给出一个灰色框。这是我的动态添加代码

Control userControl=LoadControl(“kcfinder/upload/userControl/googleMap.ascx”);
userControlDiv.Controls.Add(userControl)


那么,有些组件没有使用此方法加载吗?有什么问题吗?谢谢。

将其添加到Pre Init方法中。然后在页面生命周期中尽可能晚地引用它,例如:preprender(…)