I have a web page that makes extensive use of FindControl in the Page.Load
event to dynamicly populate label controls. Worked fine in 1.1 but I get a
"object not set to an instance...or not found" kind of message.
ex,
CType(FindControl("FY" & istring & "PayLabel"),
System.Web.UI.WebControls.Label).Text = YearString
Another difference is that in 1.1 I used a UserControl for a menu and in v2
I am using Master Pages.
Is there something I can do to retrieve this functionality? The v1.1 code is
really useful. I would hate to have to redo it...
Thanks
--
Brad
"Software is like melted pudding..." 3 1106
Hi,
Brad Roberts wrote:
I have a web page that makes extensive use of FindControl in the Page.Load
event to dynamicly populate label controls. Worked fine in 1.1 but I get a
"object not set to an instance...or not found" kind of message.
ex,
CType(FindControl("FY" & istring & "PayLabel"),
System.Web.UI.WebControls.Label).Text = YearString
Another difference is that in 1.1 I used a UserControl for a menu and in v2
I am using Master Pages.
Is there something I can do to retrieve this functionality? The v1.1 code is
really useful. I would hate to have to redo it...
is the control that is causing the problem contained within another control
(i.e., a panel)? You might have to do a recursive loop to also search
controls that themselves host other controls.
Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com
The web page has a master page with a content page. The Master page contains
a ASP.NET menu control and some images. The content is separate. The controls
that I am trying to access are standard label and textbox controls(runat =
server).
It worked fine with 1.1...
--
Brad
"Software is like melted pudding..."
"Olaf Rabbachin" wrote:
Hi,
Brad Roberts wrote:
I have a web page that makes extensive use of FindControl in the Page.Load
event to dynamicly populate label controls. Worked fine in 1.1 but I get a
"object not set to an instance...or not found" kind of message.
ex,
CType(FindControl("FY" & istring & "PayLabel"),
System.Web.UI.WebControls.Label).Text = YearString
Another difference is that in 1.1 I used a UserControl for a menu and in v2
I am using Master Pages.
Is there something I can do to retrieve this functionality? The v1.1 code is
really useful. I would hate to have to redo it...
is the control that is causing the problem contained within another control
(i.e., a panel)? You might have to do a recursive loop to also search
controls that themselves host other controls.
Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com
Found it. I just did not search as well as I should have. http://msdn2.microsoft.com/en-us/library/xxwa0ff0.aspx
--
Brad
"Software is like melted pudding..."
"Brad Roberts" wrote:
The web page has a master page with a content page. The Master page contains
a ASP.NET menu control and some images. The content is separate. The controls
that I am trying to access are standard label and textbox controls(runat =
server).
It worked fine with 1.1...
--
Brad
"Software is like melted pudding..."
"Olaf Rabbachin" wrote:
Hi,
Brad Roberts wrote:
I have a web page that makes extensive use of FindControl in the Page.Load
event to dynamicly populate label controls. Worked fine in 1.1 but I get a
"object not set to an instance...or not found" kind of message.
>
ex,
CType(FindControl("FY" & istring & "PayLabel"),
System.Web.UI.WebControls.Label).Text = YearString
>
Another difference is that in 1.1 I used a UserControl for a menu and in v2
I am using Master Pages.
>
Is there something I can do to retrieve this functionality? The v1.1 code is
really useful. I would hate to have to redo it...
is the control that is causing the problem contained within another control
(i.e., a panel)? You might have to do a recursive loop to also search
controls that themselves host other controls.
Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ivan Demkovitch |
last post by:
Hi!
I have following problem:
When I create control dynamically and assign ID to it it get's changed if
you look at output HTML.
Because I add this control inside ascx it is prefixed with...
|
by: Michael Murschell |
last post by:
If I call Page.FindControl() on an aspx, it finds the control, but if I call
it on an ASCX, it does not. Why not?
And how would I call it?
|
by: tshad |
last post by:
I am using sample code from C# and am trying to convert it to VB.Net in my
aspx page.
This works in C#:
DataGrid oGrid = (DataGrid)oItem.FindControl("DataGrid1");
I have tried all kinds of...
|
by: Terry Olsen |
last post by:
I've got a datagrid set up to display data. I've also got an
Edit,Update,Cancel column set up to allow editing of data.
I've got a DropDownList (ID="ddl3")in the EditItemTemplate for a certain...
|
by: sck10 |
last post by:
Hello,
I am trying to get the value of a control in a FormView. In vb, I would use
the following:
e.NewValues("ServiceIdeaQ01") =...
|
by: daniel.hedz |
last post by:
I am generating a usercontrol dynamically successfully, but when I try
to find that usercontrol I get a type mismatch. This is what I am
doing:
//Loading my usercontrol...
|
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= |
last post by:
Hi. I have created a UserControl ("MyUC"). I've put a bunch of instances of
that control on a Page ("Defaul.aspx"). The control works fine.
Now, I want to be able to use "FindControl()" from...
|
by: AAaron123 |
last post by:
Me.FindControl("MissionScheduleID"), below returns null.
Do you know what I'm doing wrong?
Thanks
***In my .aspx file I have:
asp:Content ID="Content3"...
|
by: AAaron123 |
last post by:
I'm this far in determining the correct code to find a textbox I need to
set.
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
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,...
|
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...
|
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...
|
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...
| |