473,385 Members | 1,218 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Postback of User Controls

I have two user controls Control1 and Control2 (.ascx) dependent on each
others input.

When the Web Page containing this control gets posted back I have some logic
to determine a value in Control1 that is an input to Control2.I find that I
am unable to achieve this because the Control1 postback is only done after
the Web Page postback.How can I force Control1 postback to occur in the Web
Page postback.

Please help me understand the process
Nov 19 '05 #1
2 1317
what do you mean by "Control1 postback is only done after the Web Page
postback" ?
Postback submits back all the values that resides inside webcontrols whose
"EnableViewState" property is set to true, and that includes all the
webcontrols inside your user controls. So you should be able to get those
values like: UserControl1.TextBoxt. Text

Hope that helps,
Alejandro Penate-Diaz.

"Vishwanathan Raman" <Vi***************@discussions.microsoft.com> wrote in
message news:6E**********************************@microsof t.com...
I have two user controls Control1 and Control2 (.ascx) dependent on each
others input.

When the Web Page containing this control gets posted back I have some
logic
to determine a value in Control1 that is an input to Control2.I find that
I
am unable to achieve this because the Control1 postback is only done after
the Web Page postback.How can I force Control1 postback to occur in the
Web
Page postback.

Please help me understand the process

Nov 19 '05 #2
Hello Vishwanathan,

Let's say we have two controls on a web form, one textbox and the other
label.
You want the text entered in the textbox to be displayed in the label on
postback of the web form.

You can write the following code in the second control's page:
Dim c1 As New Control1

c1 = CType(Page, WebForm1).Control11

Dim tb As New TextBox

tb = c1.txtInput

Label1.Text = tb.Text

This would cause the text to display in label on postback.

HTH

Mona[Grapecity]

"Vishwanathan Raman" <Vi***************@discussions.microsoft.com> wrote in
message news:6E**********************************@microsof t.com...
I have two user controls Control1 and Control2 (.ascx) dependent on each
others input.

When the Web Page containing this control gets posted back I have some
logic
to determine a value in Control1 that is an input to Control2.I find that
I
am unable to achieve this because the Control1 postback is only done after
the Web Page postback.How can I force Control1 postback to occur in the
Web
Page postback.

Please help me understand the process

Nov 19 '05 #3

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

Similar topics

3
by: Cathie | last post by:
Hi All, I have a few user controls on a page and I need to determine which control caused the PostBack. Is there anyway to do this? Thanks in advance, Cathie
5
by: Dan | last post by:
Hi, I'd like to find out the control that caused a postback to be raised. Obviously this could simply done in a control event handler. I am not going to do this method and would like no...
5
by: Matthew Louden | last post by:
I created simple ASP.NET web application to test how AutoPostBack property in a web control works. I set AutoPostBack property to be true of a web control. When I run the application, here's the...
10
by: Krista Lemieux | last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with this technology. I've been told that when I have a control, I should only bind the data to it once, and not on each post back...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
3
by: Tim::.. | last post by:
Can someone please tell my why I get the following problem when I type the following piece of code! How do I get around this??? The idea is that when a user clicks a button on a form it causes...
6
by: Alan Silver | last post by:
Hello, I have a placeholder, which gets a user control added in when the page first loads. This user control contains a dropdownlist, and I would like to get hold of the value of this drop down...
11
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
2
by: =?Utf-8?B?TG91aXNhOTk=?= | last post by:
Hello. ive just read some posts on the age old issue of losing dynamic control values on postback. Most people say recreate the controls on the onInit, but i just dont think this serves my purpose....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.