简体   繁体   中英

How do i call a void function from the codebehind?

When calling a codebehind function from a aspx file I use this tag:

<%# 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?

<%# is used to write (sanatized) output to the response, so it expects to have something to write (ie. a return value). Try using <% %> instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM