Results 1 to 3 of 3

Thread: User Control and method calls

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    90

    User Control and method calls

    Hello,

    I have a custom control that is the header for all of my web pages. I now have a need to change the logo at the top of the control based on a database value. What I did was to put a call to my method in the .ascx page here is what it looks like

    <img border="0" src='<%# GetClientLogo() %>' .......

    Here is the GetClientLogo in the codebehind .vb file

    Function GetClientLogo() As String

    if bIsLogged then
    return "../Images/" & sLogo
    Else
    return "../Images/cleardot.gif"
    endif
    end function


    When this runs I do not get any error, but it does not work. I have put it into debug and I can catch the Page_Load sub fine, but can not catch anything in the GetClientLogo. Seems as if the code is never executed. Any help would be great!

    Thanks

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    I'm assuming you are not calling Page.Databind(), because you are trying to populate the src property using a databinding expression. Trying using this:

    Code:
    <img border="0" src='<%= GetClientLogo() %>' .......

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    90

    Talking

    That is way it is always good to have another pair of eyes look at it. Simple typo. It worked! THANKS!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width