473,513 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automatically populating a UserControl

Hi,

I'm new to ASP.Net, but not to c#, so I'm finding some things a little
wierd in this internet based world, especially passing data from page
to page.

I have created a UserControl to search for data. It will first be
displayed on the homepage of my website and then on a search results
page. When the page loads up, I want to be able to repopulate the
options that were first selected on the homepage.

I would like the UserControl to handle this itself, so that if it the
fields were populated on the homepage, then they'll be populated on the
search results page.

I've sucessfully done this for TextBox controls and for DropDownList
controls using the following code.

protected void Page_Load(object sender, EventArgs e)
{
// Populate DropDownList controls
if(Request.Form[SearchRadiusList.UniqueID] != null)
SearchRadiusList.SelectedValue =
Request.Form[SearchRadiusList.UniqueID];
if (Request.Form[FilterTypeList.UniqueID] != null)
FilterTypeList.SelectedValue = Request.Form[FilterTypeList.UniqueID];

// Populate TextBox controls
if (Request.Form[txtFindTitle.UniqueID] != null)
txtFindTitle.Text = Request.Form[txtFindTitle.UniqueID];
if (Request.Form[txtSearchNames.UniqueID] != null)
txtSearchNames.Text = Request.Form[txtSearchNames.UniqueID];
}

However, I have some CheckBox controls that are also on the UserControl
and I can't find anyway to automatically populate those controls. Is
this possible? Any help would be much apprectiated.

Dec 1 '06 #1
0 944

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

Similar topics

4
1827
by: babylon | last post by:
I created a class which inherits from UserControl.. However, I can't find it in the "My User Controls" tab in designer view... How can i add it back myself? thx...
1
1138
by: manojrane2000 | last post by:
hi, how can i copy code of event of usercontrol in form on which it is placed automatically. whenever control is dragged to the form.
2
3333
by: John Ninan | last post by:
I am creating Dynamic Usercontrol in Asp.net application. In this application I have a combobox(aspx Page). Which contains various items. Based on item selected I am dynamically populating Usercontrols. Problem: When I am populating dynamic user control (ascx) page in Page_load event it works fine for the first list item from combobox. When I...
21
1854
by: Simon Verona | last post by:
Hope somebody can help! I want to automatically be able to add code to the initialize routine on a Windows form when I add a custom control that I've written to a form. Specifically, I'm trying to data bind to a normal class. So I've extended the standard text box to include a field for object name and property name. I want to be able to...
3
1408
by: Joe | last post by:
Hello All, I have a UserControl wwhich consists of one Label and one DropDownList control. I have written a Public methofd to allow me to set the Label's Text property and populate the dropdownlist with listitems. Here's the code: Public Sub PopulateDropDownList(ByVal ListCaption As String, ByVal ListItems As XmlNode) Label1.Text =...
1
1732
by: devagupt | last post by:
I have 2 tables , Production table and the Total table. The production table is made from a form and the total table just has data in it. I need to populate 2 fields from the total table into the production table. They both have a common field being the Vial #. Sometimes there are 2 identical vial # for a product but they are packed on a...
13
3509
by: Mary | last post by:
I'll pulling my hair out on this one and would be so appreciative of any help. I am creating a data entry form to enter results of a student survey. There are 40 questions on the survey. The first 7 have to do with respondent information like grade, class and age. I have those in a table with a PK of RespondentId, which is autonumbered....
3
3536
by: zacks | last post by:
I am developing an application in VS2005. I have a form that has a PictureBox control whose purpose is to be able to plop a User Control in it. And the User Control can be one of several possible User Controls and these User Controls are all different in size, some larger that the picture box it will be added to. How do I get the form to...
2
3445
by: Maddy | last post by:
I need to populate a treeview from a text file. The data in it is in the following form 1. (Parent Node) (a) (Child Node) (b) (Child Node) .. .. .. (k) (Child Node)
0
7270
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...
0
7178
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...
1
7125
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...
0
7543
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...
0
5703
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...
1
5102
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...
0
4757
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...
0
1612
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
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.