小编Sud*_*dha的帖子

.net中的Ajax响应数据

我有一个asp .net网页和一个按钮.我在按钮单击事件中调用ajax方法,如下所示

 $("#btnTest").click(function () {
                 $.ajax({
                     type: 'POST',
                     url: 'test2.aspx',
                     success: function (data) {
                         alert( data);

                     },
                     error: function (data) {
                         alert("In error  ");

                     }
                 });
             });
Run Code Online (Sandbox Code Playgroud)

成功部分警报(数据)我得到页面test2.aspx的html代码(我在ajax url中给出了一个).

在test2.aspx.cs中,代码如下

protected void Page_Load(object sender, EventArgs e)
    {
        jsonTest();
    }

    public List<string> jsonTest()
    {
        List<string> list = new List<string>();
        list.Add("aa");
        list.Add("bb");
        list.Add("cc");
        return list;        
    }
Run Code Online (Sandbox Code Playgroud)

为什么"list"中的这些数据不会作为ajax中的响应数据出现?

asp.net ajax response

6
推荐指数
1
解决办法
7125
查看次数

更改 Google 地图中的 KmlLayer 颜色

我使用以下代码在 Google 地图上添加了 KmlLayer。

var ctaLayer = new google.maps.KmlLayer('https://sites.google.com/site/.../file.kmz');
            ctaLayer.setMap(map);
            google.maps.event.addListener(ctaLayer, 'click', function (kmlEvent) {

                alert(kmlEvent.featureData.name);
            });
Run Code Online (Sandbox Code Playgroud)

我可以通过以下代码成功地抑制信息窗口。(kmlOptions 与 url 一起传递给 ctaLayer 对象)

 var kmlOptions = {
                suppressInfoWindows: true,
                preserveViewport: false,
                map: map
            };
Run Code Online (Sandbox Code Playgroud)

现在我的要求是我应该能够在脚本中传递一些颜色或某种样式来更改我创建的 KMLLayer 的颜色。(就像我压制了信息窗口一样)

实际上我想通过鼠标单击或鼠标悬停来更改 KMLLayer 中多边形(地区或区域)的颜色

请任何人给出这个问题的解决方案..

提前致谢

javascript google-maps styling

5
推荐指数
1
解决办法
2787
查看次数

如何从另一个UserControl继承UserControl?

是否可以从另一个用户控件继承用户控件?

我想要实现的是从另一个用户控件继承的用户控件.所以我有baseusercontrol.ascx,这只是文本"Stuff".然后我有另一个用户控件,childusercontrol.ascx从baseusercontrol.ascx继承.如果我没有在childusercontrol.ascx中更改任何内容,我希望baseusercontrol.ascx文本显示"Stuff".

而且我应该能够扩展派生的基本用户控制功能.

我也试着像这样,但它在我的情况还不够.

现在我的childusercontrol.ascx看起来在下面

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="childusercontrol.ascx.cs" Inherits="test_childusercontrol" %>
<%@ Register src="baseusercontrol.ascx" tagname="baseusercontrol" tagprefix="uc1" %>
Run Code Online (Sandbox Code Playgroud)

childusercontrol.ascx.cs如下

public partial class test_childusercontrol : baseusercontrol
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }   
}
Run Code Online (Sandbox Code Playgroud)

当我浏览此页面时,我得到错误

Object reference not set to an instance of an object.
Description : An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. …
Run Code Online (Sandbox Code Playgroud)

asp.net inheritance user-controls nullreferenceexception

5
推荐指数
1
解决办法
7339
查看次数

获取当前在ektron中登录的用户信息

我有一个ektron应用程序,我需要获取当前登录用户的详细信息.我想要用户名,电子邮件,显示名称,用户ID等信息.如何使用ektron api执行此操作?

api ektron

1
推荐指数
1
解决办法
1171
查看次数