0
我下面twilio教程,他们有一个文件HELLO-monkey.cshtml的内容如下:呈现在常规模型视图内容
@{
// make a list of senders we know, indexed by phone number
****var people = new Dictionary<string, string>() {
{"+14158675309","Curious George"},
{"+14158675310","Boots"},
{"+14158675311","Virgil"},
{"+14158675312","Marcel"}
};
// if the caller is known, then greet them by name
// otherwise, consider them just another monkey
string name = "Monkey";
if (!string.IsNullOrEmpty(Request["From"]))
{
name = people[Request["From"]];
}**
// now greet the caller
Response.ContentType = "text/xml";**
}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Hello @name.</Say>
</Response>
,他们希望我们来渲染页面为http://www.mysite.com/hello-monkey.cshtml ...
我怎么能写在服务器端的代码。在模型部分,这样我可以只是调用页面http://www.mysite.com/Monkey
换句话说是否有可能在Model部分转移加粗部分的代码?
谢谢德文..我今天是googlig,并且注意到了上面的代码。我会在家里尝试。非常感谢您迅速回答。 –
我会搜索互联网,看看有什么其他的twiml命令,如说,拨号等。谢谢 –
所有的twiml元素都记录在这里:https://www.twilio.com/docs/api/twiml –