摘要:
如果你将一个页面的Model设置为string类型,那么你会碰到这个错误:Illegal Characters in path似乎很奇怪,或许你甚至都不知道造成这个错误的原因是因为Model类型为string。实际上,你得到上面的错误原因是在你的Controller中,你通常调用View方法传送这个model作为唯一的参数并且这个model的值是string类型。但是你可能没有注意到View方法同样也有另外一个重载就是接受一个string作为这个View的名字。所以如果你传送这个model如下代码:return View("myStringModel");上面的代码中,你特 阅读全文
随笔档案-2012年3月23日
使用Google Weather API获取天气预报,中文支持
2012-03-23 11:48 by Fred-Xu, 2126 阅读, 收藏,
摘要:
这里我们使用asp.net来获取当地天气、时间信息前端页面:<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="GoogleWeatherAPI.aspx.cs" Inherits="EnhancementLot4.Tests.GoogleWeatherAPI" %><asp:Content ID="Con 阅读全文
浙公网安备 33010602011771号