我尝试按照此页面操作:
http://melandri.net/2009/07/03/get-location-coordinates-using-google-maps/
Run Code Online (Sandbox Code Playgroud)
但是GClientGeocoder()没有定义 - 有一个错误.
我已经在我的页面上使用google maps api了:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=<%=System.Web.Configuration.WebConfigurationManager.AppSettings["myGoogleKey"]%>&sensor=false"></script>
Run Code Online (Sandbox Code Playgroud)
如何解决我的错误?
以下是我成功使用API的方法:
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
Run Code Online (Sandbox Code Playgroud) 这是堆栈跟踪:
[FileLoadException: Could not load file or assembly 'Microsoft.Web.Infrastructure' or one of its dependencies. Access is denied.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +115
[ConfigurationErrorsException: …Run Code Online (Sandbox Code Playgroud) 我有这个:
<% if (ViewData["roots"] != null) {%>
<%Html.DropDownList("roots"); %>
<%}%>
Run Code Online (Sandbox Code Playgroud)
但这不起作用。如何查看ViewData是否存在?
这是我所拥有的:
for (i = 0; i < data.length; i++) {
$("#myDropDownLisTId").find('tbody')
.append($('<option>').attr('value', data[i].id).attr('name', data[i].name)
);
}
Run Code Online (Sandbox Code Playgroud)
但是下拉列表始终保持不变。为什么这不起作用?数据变量具有漂亮的值。另外,我想在for循环之前清空下拉列表/该怎么做?
这是我在视图中的下拉列表:
<%= Html.DropDownList("myDropDownLisTId")%>
Run Code Online (Sandbox Code Playgroud) var lastArticles = from a in be.MyTable
where a.id == 1
join c in be.OtherTable on a.parent equals c.id
orderby a.timestamp descending
select new { a, cName = c.name};
Run Code Online (Sandbox Code Playgroud)
我需要获得前5个元素.
我是这样做的
.Take(5)
Run Code Online (Sandbox Code Playgroud)
但在linq声明中有没有办法呢?