473,624 Members | 2,543 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax Toolkit - My brain hurts

The following code is the code behind of a blank page (With a scriptmanager)
on which I'm trying to simulate a problem I'm having elsewhere in a larger
app.

The app is supposed, in this case, to dynamically create a textbox and a
MaskEditExtende r and associate the 2 together.

I'm obviously doing something wrong as I'm getting a exception.
-------------------------------------------------------------
[NullReferenceEx ception: Object reference not set to an instance of an object.]
AjaxControlTool kit.MaskedEditE xtender.OnLoad( EventArgs e) +168
System.Web.UI.C ontrol.LoadRecu rsive() +65
System.Web.UI.C ontrol.LoadRecu rsive() +190
System.Web.UI.C ontrol.LoadRecu rsive() +190
System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint,
Boolean includeStagesAf terAsyncPoint) +2603
-------------------------------------------------------------
Any Ideas?

--
Rory

-------------------------------------------------------------
Public Partial Class ControlTesting
Inherits System.Web.UI.P age

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArg s)
Handles Me.Load
Controls.Add(Ne w SpecialControl)
End Sub

End Class
Public Class SpecialControl
Inherits WebControl
Implements INamingContaine r

Private Sub SpecialControl_ Load(ByVal sender As Object, ByVal e As System.EventArg s)
Handles Me.Load
Dim ControlAsTextBo x As New TextBox
ControlAsTextBo x.ID = "TextBox"
ControlAsTextBo x.CssClass = "textbox"
ControlAsTextBo x.AutoCompleteT ype = AutoCompleteTyp e.Disabled
Dim Mask As String = "LL-#####"
If Mask <String.Empty Then
Dim MyExtender As New AjaxControlTool kit.MaskedEditE xtender
MyExtender.Mask = Mask
MyExtender.Targ etControlID = ControlAsTextBo x.ID
MyExtender.Mess ageValidatorTip = True
MyExtender.OnFo cusCssClass = "MaskedEditFocu s"
MyExtender.OnIn validCssClass = "MaskedEditErro r"
MyExtender.Mask Type = AjaxControlTool kit.MaskedEditT ype.None
MyExtender.Inpu tDirection = AjaxControlTool kit.MaskedEditI nputDirection.L eftToRight
MyExtender.Acce ptNegative = AjaxControlTool kit.MaskedEditS howSymbol.None
MyExtender.Disp layMoney = AjaxControlTool kit.MaskedEditS howSymbol.None
MyExtender.Erro rTooltipEnabled = True
Controls.Add(My Extender)
End If
End Class
-------------------------------------------------------------
Jul 10 '08 #1
4 2560
Hello,

What if you add the TextBox to the "Controls" collection ?

--
Patrice
Jul 10 '08 #2
Hello Patrice" http:www.chez.com/scribe/,
What if you add the TextBox to the "Controls" collection ?
Doh! well I definitly needed to do that.

However now I'm getting something else.

I'm guessing it's because the textbox is not in the page hierarchy (only
added thus far to the specialcontrol) when 2 controls are paired up. but
I don't see how it could be as the specialcontrol has not yet been added
to the page
-------------------------------------------------------------
HttpException (0x80004005): Control 'ctl02_TextBox' of type 'TextBox' must
be placed inside a form tag with runat=server.]
System.Web.UI.P age.VerifyRende ringInServerFor m(Control control) +2049759
System.Web.UI.W ebControls.Text Box.AddAttribut esToRender(Html TextWriter
writer) +49
System.Web.UI.W ebControls.WebC ontrol.RenderBe ginTag(HtmlText Writer writer)
+17
System.Web.UI.W ebControls.Text Box.Render(Html TextWriter writer) +17
System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer, ControlAdapter
adapter) +25
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer, ControlAdapter
adapter) +121
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +22
System.Web.UI.C ontrol.RenderCh ildrenInternal( HtmlTextWriter writer, ICollection
children) +199
System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer) +20
System.Web.UI.W ebControls.WebC ontrol.RenderCo ntents(HtmlText Writer writer)
+7
System.Web.UI.W ebControls.WebC ontrol.Render(H tmlTextWriter writer) +29
System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer, ControlAdapter
adapter) +25
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer, ControlAdapter
adapter) +121
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +22
System.Web.UI.C ontrol.RenderCh ildrenInternal( HtmlTextWriter writer, ICollection
children) +199
System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer) +20
System.Web.UI.P age.Render(Html TextWriter writer) +26
System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer, ControlAdapter
adapter) +25
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer, ControlAdapter
adapter) +121
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +22
System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint,
Boolean includeStagesAf terAsyncPoint) +2558

-------------------------------------------------------------
Jul 10 '08 #3
Well, the error says it all...read it.
" Control 'ctl02_TextBox' of type 'TextBox' must be placed inside a form tag
with runat=server"

I would highlight word "must" here....

George.
"Rory Becker" <ro********@new sgroup.nospamwr ote in message
news:3a******** *************** ***@news.micros oft.com...
Hello Patrice" http:www.chez.com/scribe/,
>What if you add the TextBox to the "Controls" collection ?

Doh! well I definitly needed to do that.

However now I'm getting something else.

I'm guessing it's because the textbox is not in the page hierarchy (only
added thus far to the specialcontrol) when 2 controls are paired up. but I
don't see how it could be as the specialcontrol has not yet been added to
the page
-------------------------------------------------------------
HttpException (0x80004005): Control 'ctl02_TextBox' of type 'TextBox' must
be placed inside a form tag with runat=server.]
System.Web.UI.P age.VerifyRende ringInServerFor m(Control control) +2049759
System.Web.UI.W ebControls.Text Box.AddAttribut esToRender(Html TextWriter
writer) +49
System.Web.UI.W ebControls.WebC ontrol.RenderBe ginTag(HtmlText Writer
writer) +17
System.Web.UI.W ebControls.Text Box.Render(Html TextWriter writer) +17
System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer,
ControlAdapter adapter) +25
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer,
ControlAdapter adapter) +121
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +22
System.Web.UI.C ontrol.RenderCh ildrenInternal( HtmlTextWriter writer,
ICollection children) +199
System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer) +20
System.Web.UI.W ebControls.WebC ontrol.RenderCo ntents(HtmlText Writer
writer) +7
System.Web.UI.W ebControls.WebC ontrol.Render(H tmlTextWriter writer) +29
System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer,
ControlAdapter adapter) +25
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer,
ControlAdapter adapter) +121
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +22
System.Web.UI.C ontrol.RenderCh ildrenInternal( HtmlTextWriter writer,
ICollection children) +199
System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer) +20
System.Web.UI.P age.Render(Html TextWriter writer) +26
System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer,
ControlAdapter adapter) +25
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer,
ControlAdapter adapter) +121
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +22
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +2558

-------------------------------------------------------------

Jul 10 '08 #4
Hello george,
Well, the error says it all...read it.
" Control 'ctl02_TextBox' of type 'TextBox' must be placed inside a
form tag
with runat=server"
I would highlight word "must" here....

George.

I was about to reply that "as far as I knew" the textbox was in the form.
After all .. what else have I been adding it to?

Then I thought about that question for a moment. For anyone else who might
have come across this....

-------------------------------------------------------------
Controls.Add(So meControl)
-------------------------------------------------------------
....is not the same as...
-------------------------------------------------------------
Form1.Controls. Add(SomeControl )
-------------------------------------------------------------

Thanks for the tip George :)

Now all I have to do is to sort out that AJaxPro conflict.. ( thats for another
post)

Thanks again

--
Rory

Jul 10 '08 #5

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

Similar topics

0
1830
by: melledge | last post by:
Ajax Developers' Day to Kick Off XTech 2006 Conference Industry experts offer insight into next generation of the Web ALEXANDRIA, VIRGINIA, USA - April 25, 2006 - In response to the rapidly developing world of Ajax user interfaces on the browser, IDEAlliance (www.idealliance.org) announced today that its annual XTech Conference will kick off on May 16 with Ajax Developers' Day. XTech 2006 (www.xtech-conference.org), to be held May...
1
1750
by: mark4asp | last post by:
Which should I use: 1. "ASP.NET AJAX-Enabled Web Site" or 2. "AJAX Control Toolkit Web Site"? In the first, controls from the control toolkit start as: <cc1:SomeControl></cc1> In the 2nd, those controls are: <ajaxToolkit:SomeControl></ ajaxToolkit>
2
1449
by: =?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?= | last post by:
Hi, I am a newbie in AJAX technologies. For my application I need a combination of ListSearchExtender and FilteredTextBox control. I have downloaded the toolkit with source code, and seem to have an understanding on where to modify the controls in order to achieve what I need. I do not want to modify the toolkit source directly as those changes will be overwritten when the next update/version of AJAX will come out.
2
3807
by: Mike P | last post by:
Whenever I startup an Ajax Control Toolkit Website I get the following error: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. C:\Inetpub\wwwroot\LBM_CallRecordings2\web.config 31 Can anybody help? Any assistance would be much appreciated.
2
1586
by: Cirene | last post by:
3 quick questions... 1. Are the controls in the AJAX Futures download "beta" or the release and stable version? 2. Also, where is the best way to learn how to implement these? (Other than by downloading the stuff at asp.net/ajax.) 3. When will the new version of AJAX be out? Will it be included with the Visual Studio 2008 release?
2
14455
by: =?Utf-8?B?Q2VzYXI=?= | last post by:
I have the ASP.NET 2.0 AJAX Extensions 1.0 installed (v1.0.61025). As to the web.config file, I'm using the one created using the ASP.NET AJAX-Enabled website ... This error is due to that I'm trying to use the AJAX control toolkit, but when I try and add the controls to the toolbar of VS2005 from the dll, I get this error: C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0...
1
1529
by: GaryDean | last post by:
I have an asp.net 2.0 website using the ajax toolkit 1.0 running on server2003 using vs2005 on a 32 bit machine. I need to transfer it to my vista 64 bit machine. I'm following the MSDN article: "how to upgrade an asp.net ajax 1.0 web project to .net framework 3.5" It says to download the ajaxcontroltoolkit-framework3.5 from codeplex, and then put the dll from the sample website into my projects bin directory. However the description...
5
3094
by: simon | last post by:
hello, I have a server set up on my local (home) network and can not get an ajax application to run on the box. it works fine on our developement server and also works fine locally. I copied the application to the server, setup the website, installed the ajax extensions, also loaded/enabled front end extensions so i could load the site in visual studio 2005. when i attempt to run the site, either from the server or from another pc...
11
3027
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I have run into a situation that if a page/tab that uses the Ajax toolkit (using .net version 3.5) is closed before the Ajax enable controls complete loading, then IE locks up. Does it in both IE7 and IE8. There is no issue when the controls are allowed to complete loading. Can you please tell me the best practice that handles this? Thanks.
1
3275
by: nehalsmistry | last post by:
Hello.. I am using visual studio 2005. So there is framework 2.0 Now I m using ajax toolkit for 2.0 and installed it. But there is no option like Asp.net ajax enable website. But there is 1 option like Ajax control toolkit website. When i select this website then in default.aspx page there is one control like script manager. but in that also there is error. Its display like this: Error Creating Control- ScriptManager1 Unkown server...
0
8249
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
8685
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...
0
8633
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8348
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,...
1
6112
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
4084
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
2613
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
1797
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1493
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.