[英]How do i call a void function from the codebehind?
When calling a codebehind function from a aspx file I use this tag: 当从aspx文件调用codebehind函数时,我使用以下标记:
<%# FunctionName(param) %>
But when using this tag the function is always requires to return a string. 但是,使用此标记时,始终需要该函数返回一个字符串。 How do i call a void function from the codebehinde in an
aspx
file? 如何从
aspx
文件中的代码隐藏调用void函数?
<%#
is used to write (sanatized) output to the response, so it expects to have something to write (ie. a return value). <%#
用于将输出写(清理)到响应,因此它希望有一些写内容(即返回值)。 Try using <% %>
instead. 尝试改为使用
<% %>
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.