473,804 Members | 3,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with custom Web Controls

I've got a page with a couple ascx files on it. One od the controls displays
a user's picture, the other contains a datagrid where a user can upload more
pictures, change their default picture, etc.

When a user selects a different picture in the contorl containing the
datagrid, the code execute when the page postsback, but the control that
displays the user's picture does not.

How do I get this control to refresh on a post back?

Thanks for your help

Nov 19 '05 #1
2 1102
Could you post the code?

Nov 19 '05 #2
Are you saying that after a postback, the control that displays the user's
picture doesn't update (to the new picture for example)?
This is probably an event sequencing problem. When doing a postback, you
need to look at the events that are called:

(summarized, not complete list:)
1) Page OnLoad
2) Controls' Page OnLoad
3) PostBack event

If you notice, your postback event handler, which is where I imagine you are
modifying the picture, is called after the control's page load. Therefore
your control is rendering the correct image, you just changed it AFTER the
control did it's processing.

To fix this, I suggest moving your control's PageLoad functionality to an
OnPreRender event handler instead of the OnLoad handler. This may have
further implications depending on your code though. But for simple custom
controls it doesn't.

HTH

Steve

"tperri" <tp****@discuss ions.microsoft. com> wrote in message
news:4E******** *************** ***********@mic rosoft.com...
I've got a page with a couple ascx files on it. One od the controls
displays
a user's picture, the other contains a datagrid where a user can upload
more
pictures, change their default picture, etc.

When a user selects a different picture in the contorl containing the
datagrid, the code execute when the page postsback, but the control that
displays the user's picture does not.

How do I get this control to refresh on a post back?

Thanks for your help

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1627
by: Jai | last post by:
Dear All Creating Custom Controls but Not User Controls,How to create custom controls,i.e Extending the functionality of the Existing Controls.(Web Custom Controls). Previously i have submitted the same Query but i got replay for user controls,but my requirement is not that one.My requirement is Custom web controls.
3
1388
by: Lloyd Sheen | last post by:
I have a piece of functionallity that is replicated on several pages. This would be a good candidate for a custom control right? Well I found a couple of tutorials (none really helpful) so I created a simple asp app and added a custom control to the project. Now to the problem. I created the control using a GridFlow control so that the position of the controls within the custom control can be formatted correctly. I then added the...
0
951
by: Jay | last post by:
Hello there, I am trying to set up a test website that includes a header, footer, left and right navigator, and a central section. Since I am new to ASP and ASP.NET I was wondering what is the best thing to do. I have read that it is possible to use controls (Web Forms controls shown in Toolbox?) and custom controls. Since the left and right navigators have to include dynamic information from a DB, do I need custom controls here? My idea...
4
1736
by: Samuel Hon | last post by:
Hi I'm building a custom control which basically takes data from the user and then submits it. I would use the validator controls but if I understand correctly (I've been working with .Net for 2 weeks) you cant 'embed' them in the custom controls. Someone correct me if I'm wrong (and please point to an example :) ) So, to get around this, I'm using Javascript. In my control, I'm doing
18
1451
by: Chad A. Beckner | last post by:
I am (and have been trying!) to find a good way to do the following few things: 1. When a user requests a .aspx/.htm/.html file, the file needs to be automatically integrated into a page template. In ASP.NET, how can I do this? 2. I know I can put custom controls, map .htm/.html files to utilize custom controls, etc, but I don't want to go through and update 2000 pages (and growing) to .aspx files and then add the controls.
0
3193
by: maitrepoy | last post by:
I have to create a small addin which works on Powerpoint, Word, Outlook, and Excel on Office 2000, XP, and 2003. This addin consists in adding 2 new Buttons in the "File" Menu of office. This is properly done, but the events which should be triggered with the button.click method are not triggered in Word. I don't understand because it properly works in the 3 others host applications. If someone has an issue, I would be most grateful. Thanks...
1
1985
by: rizwanahmed24 | last post by:
Hello i have created a custom control. i have placed two template controls on it. One is check box and second is picture box. The custom control also contain two picture boxes as property. These picture boxes can be filled at design time. I want my custom control to act as container. I drag the controls from toolbox on my custom control. Everything is fine so far. But when i compile the application the two template controls i mentioned...
2
3173
by: teixeira1985 | last post by:
Hi , Due an unknown cause VS2005 started to show an error when i switch from code to design in windows forms projects. I repaired the installation but the same happens. The error is: One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.
5
3655
by: Jonathan Boivin | last post by:
Hi, I've got some problems with loading bills using a bill usercontrol I built. If I load all current bills in my test environment (156) everything is fine once, but repeating the operation (which clear all the bills and reshow all of them) four to five times and I get a Error creating window handle. I investigated on all of this, a lot, and still I'm not able to find where this problem come from. I know that the GDI objects column in...
9
2570
tlhintoq
by: tlhintoq | last post by:
Situation: A Windows Form with a single User Control containing 4 custom controls. This lets me drop the User Control on its own form to make it a dialog, or make it part of a larger configuration dialog with several such User Controls. Each custom control has a property for COM port name (serial port). Each custom control has a method for writing the settings. The user control has a GetEnumeration structure so it can be easily referenced...
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9572
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10070
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2978
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.