| | |
Update website control from usercontrol?
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2007
Posts: 28
Reputation:
Solved Threads: 0
Hi..
I am trying to update a webcontrol on a main site from a usercontrol but how can this be done.
Let's say I want to update an asp:textbox from a usercontrol on the page, but how is this done most respectfully. The usercontrol does ofcause not know the controls from the main site but I guess that the "findcontrol"-method (in the usercontrol) executed on the parent-control must do what I need (as long that I check that the control exist on the main page); but how is this done.
Something like this maybe:
I am trying to update a webcontrol on a main site from a usercontrol but how can this be done.
Let's say I want to update an asp:textbox from a usercontrol on the page, but how is this done most respectfully. The usercontrol does ofcause not know the controls from the main site but I guess that the "findcontrol"-method (in the usercontrol) executed on the parent-control must do what I need (as long that I check that the control exist on the main page); but how is this done.
Something like this maybe:
MAIN SITE:
<SOME TEXTBOX id="main">
<uc:USERCONTROL id="UC">
USERCONTROL codebehind somewhere:
((Textbox)This.parent???.findcontrol("main")).Text = "something from uc"; I think ASP.NET forum http://www.daniweb.com/forums/forum18.html can answer but I'll give a solution
if UserControl has property = "something from UC" you can from the page holds the Usercontrol say textbox.Text = UC.PropertyName; and it's the correct the usercontrol should have no information about the page it's in. but the page should have.
if UserControl has property = "something from UC" you can from the page holds the Usercontrol say textbox.Text = UC.PropertyName; and it's the correct the usercontrol should have no information about the page it's in. but the page should have.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- How To Print Directly to Printer (PHP)
- update NEWS portion on website via EMAIL? (Perl)
- Can't connect to any website hosted on a specific IP (Windows NT / 2000 / XP)
- ASP.net AJAX Update panel control (ASP.NET)
- Classifieds Ads Submission Website for Sell (Websites for Sale)
- Auto Update and manual update fails on XP SP2 Home Edition (Windows NT / 2000 / XP)
- Major new update of Website (Website Reviews)
- Big Time Bug On New Windows Update (Windows NT / 2000 / XP)
Other Threads in the C# Forum
- Previous Thread: C# code to deny access to local hard disk drives
- Next Thread: Property Grid Problem
| Thread Tools | Search this Thread |
.net access ado.net algorithm array backup barchart bitmap box broadcast buttons c# check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime decryption degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest i18n image imageprocessing index input install java label list listbox listener mandelbrot math microsystems mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer update uploadatextfile usercontrol users validation view visualstudio webbrowser whileloop windows winforms wpf xml






