473,661 Members | 2,464 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 2632
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.goo glegroups.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="pag e.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="Micros oft Visual Studio .NET 7.1" name="GENERATOR ">
<meta content="Visual Basic .NET 7.1" name="CODE_LANG UAGE">
<meta content="JavaSc ript" name="vs_defaul tClientScript">
<meta content="http://schemas.microso ft.com/intellisense/ie5"
name="vs_target Schema">
<LINK href="styles.cs s" 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"><te st: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("pa rt2.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
1175
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
1925
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 page to the second page of the datagrid, the user contorl stops working correctly (displaying the correct data). I have attached the code that is envolved. Thanks a lot
2
1057
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 object. Everything works fine... except... ....when I click too quickly from one page to another (or quickly reload the same page). When I do, I get the following error:
8
6902
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 access to the page class? Thanks Ali
2
1500
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 products catalogue and the products show in a datagrid in one of the user controls. This datagrid has many rows and columns of images and this is what I'm most interested in caching. If I put <%@ OutputCache Duration="500" VaryByParam="MenuID"...
6
2504
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 begin showing up which means the page gets longer so the scroll bar is needed to reach the ones at the bottom. The problem I have is that when I´m working with the user control at the bottom of the page and this page needs to be reloaded the...
3
13605
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 passed to this user control. How do I (or from where do I) call this function? I tried several ways like: this.Attributes.Add("onLoad", "javascript:openDoc();"); in the page_load / page_prerender etc...
4
1971
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 to an instance of an object." in my server control (ascx.cs file)
6
10107
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 Page_Load(object sender, EventArgs e) { UserControls_WebUserControl myControl = new UserControls_WebUserControl(); PlaceHolder1.Controls.Add(web);
0
8343
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
8855
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8758
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
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...
1
6185
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
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();...
1
2762
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
1986
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1743
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.