Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to call a code behind function from a .aspx file

How to call a code behind function from a .aspx file

Scheduled Pinned Locked Moved ASP.NET
helptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Puneet Bhatnagar
    wrote on last edited by
    #1

    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

    A G 2 Replies Last reply
    0
    • P Puneet Bhatnagar

      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

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      :-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

      1 Reply Last reply
      0
      • P Puneet Bhatnagar

        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

        G Offline
        G Offline
        Gamzun
        wrote on last edited by
        #3

        you can use using also

        Please don't forget to mark 'Good Answer', if you find it really a good one! Kashif

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups