Solved

Find a control inside a Telerik control

Posted on 2009-03-28
2
2,200 Views
Last Modified: 2012-05-06
I'm having some issues finding a control nested 2 levels deep.

My primary container is a RadPageView and I need to find a control inside of a Formview nested inside of that. My target is the following control:

 <asp:Image ID="NPPhoto" runat="Server" CssClass="detailPhoto" />

I placed my structure in the code snippet section. I have the following code, but it's not working.

        Dim imageURL As String
        If (UserID = "" Or Not System.IO.File.Exists(Server.MapPath("~/images/profile_images/" & UserID & ".jpg"))) Then
            imageURL = "~/images/notavailable.gif"
        Else
            imageURL = "~/images/profile_images/" + UserID + ".jpg"
        End If
        Dim Photo As Image = CType(NPProfile.FindControl("NPPhoto"), Image)
        Photo.ImageUrl = imageURL
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="3">
            <telerik:RadPageView ID="RadPageView1" runat="server">
                <asp:FormView ID="NPProfile" runat="server">
                    <ItemTemplate>
                    <div id="Desc_Photo">
                                <asp:Image ID="NPPhoto" runat="Server" CssClass="detailPhoto" />
                            </div>
                        <div class="Desc_Container">

Open in new window

0
Comment
Question by:ApexCo
2 Comments
 
LVL 10

Expert Comment

by:jabcoco
ID: 24045730
I will suggest post on Telerik forum.
It's free and all question i've ask on their forum has receive a anwser before 48h.

http://www.telerik.com/community/forums.aspx

Register, it's free, and free for trial user too.
0
 
LVL 8

Accepted Solution

by:
ApexCo earned 0 total points
ID: 24111768
Just wanted to update, I solved my issue.

Once I moved my code for finding the control into the databound event, everything worked perfect.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question