473,322 Members | 1,347 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,322 software developers and data experts.

Need help with LoadControl

When I try to use LoadControl I get the error message below. Any help would
be great.

Kurt

Control '_ctl0_Classification' of type 'TextBox' must be placed inside a
form tag with runat=server
Nov 17 '05 #1
5 2857
Any control that can cause PostBAck should be placed within <form> tags...

<form
... All PostBack controls go here.
</form>

--
Naveen K Kohli
http://www.netomatix.com
"Kurt" <k_******@larimore.net> wrote in message
news:OS****************@TK2MSFTNGP11.phx.gbl...
When I try to use LoadControl I get the error message below. Any help would be great.

Kurt

Control '_ctl0_Classification' of type 'TextBox' must be placed inside a
form tag with runat=server

Nov 17 '05 #2
Hi,
To be more accurate. All "web forms" controls must be under Form tag
with runat=server attribute. this attribute guarantee the postback
behavior.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
How do I control that if I am loading a control dynamically?

Kurt

"Natty Gur" <na***@dao2com.com> wrote in message
news:uG**************@tk2msftngp13.phx.gbl...
Hi,
To be more accurate. All "web forms" controls must be under Form tag
with runat=server attribute. this attribute guarantee the postback
behavior.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #4
I got it this is what I used.
this.FindControl("Test").Controls.Add(offense);

"William F. Robertson, Jr." <wf*********@kpmg.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
How are you trying to load it in code? Do you have a placeholder?

bill

"Kurt" <k_******@larimore.net> wrote in message
news:O0**************@tk2msftngp13.phx.gbl...
How do I control that if I am loading a control dynamically?

Kurt

"Natty Gur" <na***@dao2com.com> wrote in message
news:uG**************@tk2msftngp13.phx.gbl...
Hi,
To be more accurate. All "web forms" controls must be under Form tag
with runat=server attribute. this attribute guarantee the postback
behavior.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Nov 17 '05 #5
this.FindControl("FormName").Controls.Add(MyContro l);

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #6

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

Similar topics

0
by: George Durzi | last post by:
I have a C# in my web application called BasePage. It inherits from System.Web.UI.Page. I'm using page inheritance in my web app so all my pages have an identical look and feel by inheriting from...
1
by: Martine | last post by:
Hi there! I have a problem with programmatically adding user controls to my mobile webforms. If I load my usercontrol programmatically (in the Page_Load), the object is instantiated, I have...
2
by: Wade Beasley | last post by:
I have a web project that currently has a standard header, footer, and menu ascx files. I am now suppose to change the project to allow a user to choose from 3 different views, ie 3 different...
3
by: Robert Walter | last post by:
I want to user the Page method LoadControl inside the Global.asax.cs but when I instantiate a page and try it I get the following error... System.NullReferenceException: Object reference not set...
1
by: Hasani \(remove nospam\) | last post by:
The way the system works is, you create a user control (ascx) that will be a template and must implement the interface IPageTemplate. You then create one or more user controls (ascx) that implement...
2
by: Keith Patrick | last post by:
Maybe my expectations are just too low because I haven't read much documentation on this method, but basically, I am trying to load a user control dynamically without using a virtual path (I have...
1
by: Andreas | last post by:
Hallo zusammen, ich kämpfe seit Tagen mit folgendem Problem und habe bisher leider keine Lösung gefunden. Vielleicht kann mir jemand helfen: Ich möchte auf einer Seite (test.aspx) ein...
5
by: Andreas | last post by:
Hello, I have the following problem: I want to add to my site (test.aspx) one (1) UserControl (customer.ascx) several times - dynamically with a placeholder. As well I want to hand off...
9
by: Alan Silver | last post by:
Hello, I have a user control which I am trying to load dynamically, but am running into problems. I think the problem is because I have two .ascx files that refer to the same .ascx.cs file. A...
0
by: Carl Wright | last post by:
Hi I'm having this major issue loading a usercontrol at runtime using the overload on Loadcontrol(type,object). Here's the code in the aspx code-behind file Dim myControl As New Control Dim...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.