473,507 Members | 6,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

reloading a user control from within another user contorl

TB
Hi All:

A very simple question, which I hope has a simple answer:

On page.aspx I have two user controls: part1.ascx and part2.ascx

How can I trigger the reloading of part2.ascx from within part1.ascx?

In other words I would like part1.ascx to contain something like:

if whatever then
reload part2.ascx
End if

Any suggestions will be highly appreciated.

Thanks

TB

Feb 12 '06 #1
2 2627
use the loadcontrol method

i could never get the child control script to work.
it's like if it was not considered.

"TB" <tb********************@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hi All:

A very simple question, which I hope has a simple answer:

On page.aspx I have two user controls: part1.ascx and part2.ascx

How can I trigger the reloading of part2.ascx from within part1.ascx?

In other words I would like part1.ascx to contain something like:

if whatever then
reload part2.ascx
End if

Any suggestions will be highly appreciated.

Thanks

TB

Feb 13 '06 #2
TB
Hi, thanks for replying, but do you mind cutting in out in cardboard
letters for this newbie. Perhaps I should also explain myself a little
better.

Page.aspx looks like this (simplified here)

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="page.aspx.vb" Inherits="test.home" %>
<%@ Register TagPrefix="test" Tagname="part1" Src="part1.ascx"%>
<%@ Register TagPrefix="test" Tagname="part2" Src="part2.ascx"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="styles.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<div id="wrapper">
<form id="Form1" method="post" runat="server">
<div id="top"><test:part1 id="part1"
runat="server"></test:part1></div>
<div id="bottom"><test:part2 id="part2"
runat="server"></test:part2></div>
</form>
</div>
</body>
</HTML>

Now, inside part1.ascx, I am paging through records in a table (lets
call it table1) of a database, displaying a lot of fields. However
there is another table in part2.ascx which shows related records from
another table (table2) in a datagrid. So what I want is that each time
a new record is displayed in part1.ascx, part2.ascx is reloaded
displaying the related records from table2 in the datagrid. My idea is
therefore to store as a session variable the current record number (the
primary key) of table1, and then add the necessary code to the click
events of the "next" and "previous" buttons of part1.ascx which would
update the session variable and then cause the part2.ascx to reload.
The session variable mentioned before would act as the variable element
in the sql statement firing the dataadapter behind the datagrid in
part2.ascx. Following your advice, I have tried to simply add:

loadcontrol("part2.ascx)"

to the click event codes (after updated the session variable) but
nothing happens.

Thanks in advance,

TB

Feb 13 '06 #3

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

Similar topics

0
1169
by: TJ | last post by:
Dear Sir/Madm Environmen ..NET runtime 1. IE 6. I made one User Control form to host in Internet Explorer class MyUserControl : UserControl ... void ConnectToServer()
0
1914
by: Zi | last post by:
I have a user control within a data grid. I am binding the user control to one of the values from the data grid. The data grid implements paging. It is all working ok for the first page but once i...
2
1049
by: Walter | last post by:
Each of the aspx pages in my application have a User Control called "WrapStart". In a page's Page_Load() method, I set various properties and/or call various methods of the WrapStart control...
8
6894
by: A.M | last post by:
Hi, I know that i can use Page.Request.Path to find what is the current page name. The problem is I can't access to Page object inside a user control. Is there any way that a user control...
2
1492
by: moondaddy | last post by:
My default page stays constant in the site and all the content in the body of the page is produced with user controls in a table cell for the body section. The main function of this site is a...
6
2501
by: Jorge Luzarraga Castro | last post by:
Hey, hope you can help with this. I have an aspx page which contains several User Control. At the beggining there´s only one visible User Control but after working with the page additional UC...
3
13598
by: anadimpa | last post by:
Hello all I build a javascript function string in the code behind and register it in the Page_Load of my User Control. I do this because I build the javascript based on some variables that are...
4
1959
by: rushikesh.joshi | last post by:
Hi All, I have created my own WebControl and want to add it in my aspx page at runtime. it's compiling perfectly, but when i m going to execute, it gives me error of "Object reference not set...
6
10098
by: alun65 | last post by:
I'm having trouble programmatically adding a user control and then setting some of it's server controls. I add the user control to the code behind and add it to a placeholder: protected void...
0
7223
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,...
0
7110
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...
0
7314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7482
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...
0
5623
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,...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.