简体   繁体   English

我如何从后面的代码中调用void函数?

[英]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.

相关问题 如何从JavaScript调用代码隐藏功能? - How can I call a codebehind function from JavaScript? 如果返回一个void函数,如何停止执行下一个函数调用? - If one void function returns, how do I stop the next function call from executing? 在后台代码中创建新的CheckBox时,如何连接客户端Javascript函数调用? - How do I wire up a client Javascript function call when creating a new CheckBox in my codebehind? 如何从C#调用具有void * callback和object参数的C ++ Dll中的函数 - How do I call a function in a C++ Dll from C# that has void* callback and object parameter 如何从另一个ASP.NET应用程序调用codebehind方法? - How do I call codebehind method from another ASP.NET app? 如何从 ASPX 文件(不是代码隐藏)中调用异步方法? - How do I call an asynchronous method from within an ASPX file (not codebehind)? 如何从gridview按钮单击事件代码背后调用javascript函数 - how to call javascript function from gridview button click event codebehind 如何在asp.net中从javascript调用代码隐藏函数? - How to call a codebehind function from javascript in asp.net? 如何从asp.net中的代码隐藏调用javascript函数 - how to call a javascript function from codebehind in asp.net 从CodeBehind文件中调用JS函数 - Call JS function from CodeBehind file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM