【问题标题】:Dynamically adding ASP.Net userControl with Google Map使用 Google Map 动态添加 ASP.Net userControl
【发布时间】:2012-10-21 23:22:38
【问题描述】:

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

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

那么,是不是有些组件没有用这个方法加载?有什么问题?谢谢。

【问题讨论】:

    标签: asp.net google-maps user-controls


    【解决方案1】:

    在 Pre-Init 方法中添加它。然后在页面生命周期中尽可能晚的引用它,例如:Pre-Prender(...)

    【讨论】:

      猜你喜欢
      • 2011-12-12
      • 1970-01-01
      • 2017-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-10
      相关资源
      最近更新 更多