473,395 Members | 2,713 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,395 software developers and data experts.

How to pass some kind of data to a given Web User Control?

Hi,
I need to pass some variables to a given web user ctrl, say,
myctrl.ascx. e.g., I need to include the user control within a web form
as follows:

myctrl.ascx?myparam=myvalue&whatever=another_value

whilst somewhere else I would call the mentioned ctrl as

myctrl.ascx?myparam2=myvalue&whatever2=another_val ue

What's the way to go?

Any help would be highly appreciated,

Cheers,
Mehdi

Nov 19 '05 #1
1 1201
If you create public properties in your web control, you can set those
in the tag you put on the aspx page.

ascx code behind:
public int MyParam{
get{...}
set{...}
}

aspx page with user control
<cc1:MyControl MyParam="99"></cc1:MyControl>

public properties of a control are also available in the aspx code
behind as well.

Nov 19 '05 #2

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

Similar topics

4
by: tom | last post by:
Hi Experts, I want to pass the selectedDate value from my calender form to another web form or a web user control. Could you please show me how to do this? Thanks in advance.
9
by: Frank Rizzo | last post by:
I've got a number of user controls on the web page. How can I pass some data to it? I don't see where the user control is instantiated in the page code-behind page. Thanks.
5
by: Ben | last post by:
Hi I am using a User Control which is referenced by an ASPX page. How can I pass a string parameter to the user control, from the base ASPX page. Thanks Ben
8
by: darrel | last post by:
I'm still trying to fully understand how best to pass variables between pages/usercontrols/each other. On a current site I've done, I've had one userControl do the logic and set the variable,...
2
by: Robert | last post by:
I have a form (frmWorksheet) that contains project information from a Projects table. The form contains a number of fields including ClientID and Project. On the form header is two combo boxes,...
6
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few...
0
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I have a aspx page that I want to pass data into dynamically created webparts. Each web part will contain a user control I created (WebUserControl1) that exposes a public property (.TestData). ...
3
by: =?Utf-8?B?UmljaCBIdXRjaGlucw==?= | last post by:
I have a form, Form1, that shows an instance of Form2 when a user clicks a button. On Form2, the user is to select items, Customer Names for example, from a datagrid control. When the user clicks a...
2
by: simon | last post by:
Hello, relatively new .net programmer. using vb.net (v2.0) I have an aspx page that contains 2 user controls (ascx) on it. the left control is basically navigation hyperlinks the right control...
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?
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...
0
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
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...
0
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
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,...

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.