How to call a code behind function from a .aspx file
-
Hi, Please let me know how to call a function written in Code Behind file, in a different folder, from a .aspx control. Here is what I am doing: <img src = "<%=DAL.CommonUtil.GetConfigValue("ImagePath")%>/header_bg.jpg" alt ="headerImage" /> DAL - FolderName CommonUtil - Class GetConfigValue - Function. Error Message - The name DAL does not exist in current context DAL folder is under App_Code folder. I tried appending App_Code in my src string, however I am still etting the error Error Message - The name App_Code does not exist in current context. I really appreciate the help and would like to thank you in advance. Thanks & Regards Puneet
-
Hi, Please let me know how to call a function written in Code Behind file, in a different folder, from a .aspx control. Here is what I am doing: <img src = "<%=DAL.CommonUtil.GetConfigValue("ImagePath")%>/header_bg.jpg" alt ="headerImage" /> DAL - FolderName CommonUtil - Class GetConfigValue - Function. Error Message - The name DAL does not exist in current context DAL folder is under App_Code folder. I tried appending App_Code in my src string, however I am still etting the error Error Message - The name App_Code does not exist in current context. I really appreciate the help and would like to thank you in advance. Thanks & Regards Puneet
:-D :-D Each class represents an unique Namespace. Use
<%@ Import
to import the namespace and then use it in server tags. You dont have to look for folders, its the namespace that matters. ;)
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
Hi, Please let me know how to call a function written in Code Behind file, in a different folder, from a .aspx control. Here is what I am doing: <img src = "<%=DAL.CommonUtil.GetConfigValue("ImagePath")%>/header_bg.jpg" alt ="headerImage" /> DAL - FolderName CommonUtil - Class GetConfigValue - Function. Error Message - The name DAL does not exist in current context DAL folder is under App_Code folder. I tried appending App_Code in my src string, however I am still etting the error Error Message - The name App_Code does not exist in current context. I really appreciate the help and would like to thank you in advance. Thanks & Regards Puneet