473,591 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access a user control via a "page src=" .aspx page

Sorry if the title is a little confusing... Here is the problem.

I am working with a "default.as px" page that uses a user control I
made:

------------------------------
| default.aspx |
------------------------------

<%@ Page language="C#" CodeBehind="Cha rtPage.cs"
AutoEventWireup ="false" Inherits="Chart Page.ChartPageF orm" %>
<%@ Register TagPrefix="Acme " TagName="Login"
Src="chartPerfo rmance.ascx" %>
<form runat="server">
<Acme:Login ID="chart1" runat="server" Category="crap crap crap"/>
</form>

------------------------------
| chartPerformanc e.ascx |
------------------------------

<%@ control inherits = "Graphs.Histogr amBenchmark" src =
"chartPerforman ce.cs" %>
Chart Your Performance:
<ul>
<li>Category: <asp:label id="myCategory " runat="server" /></li>
<li>Rounds Played To Chart: <asp:textbox id="txtRoundsTo Chart"
runat="server"/></li>
<li># Of Holes Played: <asp:textbox id="txtNumHoles Played"
runat="server"/></li>
</ul>
<asp:button text="Chart Performance" OnClick="Submit Btn_Click"
runat="server"/><br>
<asp:label id="Result" runat="server" />

------------------------------
| chartPerformanc e.cs |
------------------------------

/*
* Chart Performance Custom User Control
*/
using System;
using System.Web.UI;
using System.Web.UI.W ebControls;

namespace Graphs {
// charts the performance of all rounds within search query...
public class HistogramBenchm ark : UserControl {
public Label myCategory;

private string _category = "Sample Category";
public string Category {
get { return _category; }
set
{
_category = value;
myCategory.Text = _category;
}
}

public TextBox txtRoundsToChar t;
public TextBox txtNumHolesPlay ed;
public Label Result;

public void SubmitBtn_Click (Object sender, EventArgs e) {
Result.Text = "<li>Rounds To Chart: " + txtRoundsToChar t.Text +
"</li><li># Holes Played: " + txtNumHolesPlay ed.Text;
}
}
}

------------------------------
| ChartPage.cs |
------------------------------

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.W ebControls;

namespace ChartPage {
public class ChartPageForm : Page {
protected System.Web.UI.W ebControls.Text Box MyTextBox;
protected System.Web.UI.W ebControls.Butt on MyButton;
protected System.Web.UI.W ebControls.Labe l MyLabel;
// protected Graphs.Histogra mBenchmark chart1;

private void Page_Load(Objec t sender, EventArgs e) {
// i need to access my chart1 that is on the default.aspx
// now i have read that I should use the above naming convention
// so that I can use something like
// chart1.Category ="Set category to something....";
}

public void MyButton_Click( Object sender, EventArgs e) {
MyLabel.Text = MyTextBox.Text. ToString();
}
}
}

In short on the ChartPage.cs is there someway I can access the chart1
UserControl and its properties. I have looked everywhere. The IMPORTANT
thing to note is that I DO NOT want to compile anything before using
it, personally I think it is ugly the way you HAVE to compile versions
of your component that you are STILL developing forcing recompiles
etc....

Best Regards,
Terrance A. Snyder

Nov 19 '05 #1
1 2119
Sorry default.aspx should be like the below
------------------------------
| default.aspx |
------------------------------

<%@ Page language="C#" Src="ChartPage. cs"
AutoEventWireup ="false" Inherits="Chart Page.ChartPageF orm" %>
<%@ Register TagPrefix="Acme " TagName="Login"
Src="chartPerfo rmance.ascx" %>
<form runat="server">
<Acme:Login ID="chart1" runat="server" Category="crap crap crap"/>
</form>
The change was SRC="CharPage.c s"...

Again I still can't access the properties of the Acme:Login UserControl
I added to the default.aspx page from my ChartPage.cs...

Nov 19 '05 #2

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

Similar topics

23
16124
by: Loony | last post by:
I have got a code like this in HTML section in ASP file which includes javascript file! The script works under MS IE but doesn't with Firefox! Can anybody tell me what is wrong? <HTML> <HEAD><TITLE></TITLE> <SCRIPT LANGUAGE="JavaScript" SRC="../inc/JSfile.js"><SCRIPT> <SCRIPT> <!-- other javascript scripts working propely
0
1387
by: JFF | last post by:
Hello I would like to transmit commands from a Data Access Page to my access database. The user see a link or button in his HTML page ; he clics and the result should be to transmit to the Access DB something like a macro or VBA sub, ordering for example "DoCmd.OPENREPORT ...", or export a query to XML, or something lik that. I am afraid it is impossible, but I am not very expert in DAPs, I still hope.
0
1484
by: Manystrengths | last post by:
I must warn all of you willing to help me that this is my first go at designing a functional data access page. Please bear in mind that we all start somewhere so if I should be asking the absolute dumbest questions you've heard in a while remember I'm not the first. I am specifically looking for step by step direction. I also feel I must make you aware of my dedication. You see, I need to complete this project to get a nice bonus for...
5
1368
by: kelvin H via AccessMonster.com | last post by:
Is it good to use Data Access Page to access Database ? (and put it on the web ~?) -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/200510/1
1
1634
by: chavdar | last post by:
I need to inherit web user control page, how can I do this? Thanks, Chavdar
0
1407
by: conckrish | last post by:
Hi all, Can anyone tell me how to add Click event for dynamically created User control page ?? I have a user control page in datagrid cell. when i click this user control page it ll redirect to another page. plz tell me how to add click event ??? Thanx.
6
3199
by: conckrish | last post by:
Hi all Can anyone tell me how to add a click event for a user control page dynamically??? Thanx Krish.
0
1386
by: Spencer Lee | last post by:
I have encountered a very unique problem (for me): I created a data access page, with 3 levels of groups. I put the file on the web folder (intranet), and it seems like everything is working fine. However, the data access page, when opened from my computer, allows user to add new record to the page. When it is opened from other computer, the "add record" button is inactive. One thing I notice is that, the page has the "add record"...
4
2421
by: evenlater | last post by:
Anybody know how to prevent the annoying Access 2007 "Getting Started with Access" page from showing up when the database is closed using DoCmd.Quit? My database is used in a terminal server environment and I need to be able to prevent users from creating new databases or opening existing ones using that page. Thanks!
3
2576
by: JP Romano | last post by:
Hi - I'm putting together a status report summary for a team of about 15 based in the US (various places), London, Hong Kong, etc. The users have expressed interest in using a web form (data access page), which I have submitting data to an Access db on a shared network repository. They want the forms to be saved in a Sharepoint repository for easy access. So far, so good. Where I need a little help is in setting the data access page to...
0
7934
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
7870
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
8236
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...
1
7992
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6639
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...
1
5732
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
5400
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
3850
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2378
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

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.