Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using findcontrol on parent page

Status
Not open for further replies.

rotsey

Programmer
Nov 23, 2004
135
AU
Hi,

This might stump some people.

I am creating my own charts using drawing namespace and I using an image control to draw to.

I have a called "Viewcharts.aspx" with a label and a image control.

I set the src property to the image control like src="Charts.apsx". This calls charts.aspx to draw the chart. The page uses the code
bmap.Save(Response.OutputStream, ImageFormat.Jpeg).

Problem is I want to set the chart headings in the label control in "Viewcharts.aspx".

So I thought I would use the Parent property like this

Code:
Dim l as label

l = ctype(Parent.FindControl("lblHeading"), label)

But this doesn't work.

Any ideas appreciated???
rotsey
 
That won't work because the chart page only exists as a source for the image (and that only returns a JPEG) so the current page has no concept of the Viewcharts.aspx page.

Personally I wouldn't do it by setting the source of an image. I would create a usercontrol as that way you will be able to set your own Properties that can change the output accordingly.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
oh ok.

Not with you re usercontrol. What do you draw to then????
 
You still use an image control but you would have this in your UserControl. You would just include the UserControl on your page and set the relevant properties so that the image in the control is drawn.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
you still need to set the src to a page don't you???
 
No - you don't have a image control on the page. The image control is in the UserControl so that can get it's source from an image that you save to disk.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top