在方案中使用多个lambda表示意味着什么?(What does the use of multiple lambdas in scheme mean?)
我目前正在学习计划,并且我遇到了这些功能:
(define t (lambda (x) (lambda (y) x))) (define f (lambda (x) (lambda (y) y)))
显然它们是作为功能的真假的表示。 我不知道为什么!
我有两个问题:
1)连续的lambda表示什么意思? 我只习惯看到一个用来传递参数给函数的lambda函数; 即
(define add (lambda (x y) (+ x y)))
并通过调用
(add 1 5)
我将提供6
作为输出。2)如何使用这些真假功能?
I am currently learning scheme and I came across these functions:
(define t (lambda (x) (lambda (y) x))) (define f (lambda (x) (lambda (y) y)))
Apparently they are representations of true and false as functions. I have no idea why!
I have two questions:
1) What do the successive lambdas mean? I am only used to seeing a single lambda which is used to pass arguments to a function; i.e.
(define add (lambda (x y) (+ x y)))
And by calling
(add 1 5)
I would be provided with6
as output.2) How would these true and false functions be used?
原文:https://stackoverflow.com/questions/14145789
最满意答案
您无法获得对该
asp:Content
的引用的原因asp:Content
控制是因为它在页面与主页面结合时不会停留。 基本上,ASP从这些asp:Content
部分中获取所有控件,并使它们成为ContentPlaceholder
内的ContentPlaceholder
控件的子项。正如MSDN所说: 在运行时不会将内容控件添加到控件层次结构中。 相反,内容控件中的内容直接合并到相应的ContentPlaceHolder控件中。
这意味着如果您想要为该部分添加更多控件,则必须在主页面中引用
ContentPlaceholder
控件并将其添加到该控件中。 就像是:ContentPlaceHolder myContent = (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolder1"); myContent.Controls.Add(??);
注意你正在使用
ContentPlaceHolderID
值,而不是asp:Content
部分的ID
。The reason you can't get a reference to that
asp:Content
control is because it does not stay around when the page is combined with the masterpage. Basically ASP takes all the controls from inside theseasp:Content
sections and makes them children of theContentPlaceholder
controls inside the masterpage.As MSDN says: A Content control is not added to the control hierarchy at runtime. Instead, the contents within the Content control are directly merged into the corresponding ContentPlaceHolder control.
That means that if you want to add more controls to that section, you will have to get a reference to the
ContentPlaceholder
control in the masterpage and add them to it. Something like:ContentPlaceHolder myContent = (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolder1"); myContent.Controls.Add(??);
Notice you are using the
ContentPlaceHolderID
value, NOT theID
of theasp:Content
section.
相关问答
更多-
在MasterPage.cs文件中添加Label的property ,如下所示: public string ErrorMessage { get { return lblMessage.Text; } set { lblMessage.Text = value; } } 在您的aspx页面上,在页面指令下面添加: <%@ Page Title="" Language="C#" MasterPageFile="Master P ...
-
它的工作方式有点不同。 它将您的内容页面的内容注入ContentPlaceholders(有效地替换那里的任何内容)。 您可以将ContentPlaceholder放在您希望显示内容页面html的位置。