Hi,
I use ImageManager as standard alone in one usercontrol. I need to cast the value from one text box in my current page to use for creating the folder to store. I try to create one public interface to make, adding in the codebehind of the page the interface and the cast in the usercontrol, but my code not compile error IMetaAuthor is not definied in the usercontrol. Any way?
aspx is Text ID="Author"
aspx.cs
ascx :
Regards
I use ImageManager as standard alone in one usercontrol. I need to cast the value from one text box in my current page to use for creating the folder to store. I try to create one public interface to make, adding in the codebehind of the page the interface and the cast in the usercontrol, but my code not compile error IMetaAuthor is not definied in the usercontrol. Any way?
aspx is Text ID="Author"
aspx.cs
// Interface
public interface IMetaAuthor
{
MetaAuthor Author {
get; }
}
ascx :
string Author = ((IMetaAuthor)this.Page).Author;
Regards
5 Answers, 1 is accepted
0
Hi Pierre,
If you want to access any class or interface from several pages, you need to add it in the App_Code folder, otherwise it will be accessible only in the page in which it is defined.
Let us know if you need further assistance.
Greetings,
Sophy
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
If you want to access any class or interface from several pages, you need to add it in the App_Code folder, otherwise it will be accessible only in the page in which it is defined.
Let us know if you need further assistance.
Greetings,
Sophy
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Pierre
Top achievements
Rank 1
answered on 17 Jul 2008, 01:20 PM
Hi,
I try this way during one day but no result. I need to catch the value added in the TextBox during the session of this page. Do you know one solution ?
I have one TextBox with ID="Author". The user add the name in this textBox and I need to take the value to use in the ImageManager. The problem is that this textBox is inside one another usercontrol. I have one masterpage with two usercontrols. I need to pass the value of one to another during the session of this page at screen. Could you help me
Regards
I try this way during one day but no result. I need to catch the value added in the TextBox during the session of this page. Do you know one solution ?
I have one TextBox with ID="Author". The user add the name in this textBox and I need to take the value to use in the ImageManager. The problem is that this textBox is inside one another usercontrol. I have one masterpage with two usercontrols. I need to pass the value of one to another during the session of this page at screen. Could you help me
Regards
0
Hello Pierre,
Judging from your words the problem you experience is not related to the ImageManager dialog itself. You will have the same scenario if you replace the ImageManger with an ordinary UserControl. I prepared an example based on the description of your scenario. Please, find it attached. I hope it helps you achieve the desired functionality.
Greetings,
Sophy
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Judging from your words the problem you experience is not related to the ImageManager dialog itself. You will have the same scenario if you replace the ImageManger with an ordinary UserControl. I prepared an example based on the description of your scenario. Please, find it attached. I hope it helps you achieve the desired functionality.
Greetings,
Sophy
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Pierre
Top achievements
Rank 1
answered on 22 Jul 2008, 06:36 PM
Hi Sophy,
Thanks. I used this method but not working with my Sitefinity Cms. I have one error on line : System.NullReferenceException: Object reference not set to an instance of an object. ( Class added, sample working, Usercontrols1 and 2 changed like your sample)
error TextBox txtbox = (TextBox)Page.Master.FindControl("TextBoxControl").FindControl("Author");
Thanks. I used this method but not working with my Sitefinity Cms. I have one error on line : System.NullReferenceException: Object reference not set to an instance of an object. ( Class added, sample working, Usercontrols1 and 2 changed like your sample)
error TextBox txtbox = (TextBox)Page.Master.FindControl("TextBoxControl").FindControl("Author");
I have tested many methods with no result. Tested adding textBox txtbox hidden in control to fix but nothing. After this I have used javascript to change the label with success but unable to cast from Load_Page to use in ImageManager definition. I can't pass the variable !
Help.
0
Hello Pierre,
When using FindControl in Sitefinity page, you should not look for the control in the masterpage, but rather in the IPage, because the pages are generated on the fly (they do not exists on the file system).
Sincerely yours,
Georgi
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
When using FindControl in Sitefinity page, you should not look for the control in the masterpage, but rather in the IPage, because the pages are generated on the fly (they do not exists on the file system).
Sincerely yours,
Georgi
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.