Saturday, March 24, 2012

Wizard Control problem

This is an interesting one, although I did have it working earlier, it has since ceased to function.

I have a wizard control in an update panel on a user control on a page which uses a master page. oh, on a second note, a calendar extenders style / theme seems to break if the calendar control is not on the first page displayed in the wizard bar; but thats another story and not my immediate consern.

the problem is, that the next button returns a javascript error " 'null' is null or not an object, line 105 " ... but the odd thing is that it only breaks on the second page, so the first click of the next button works and sends you to the second page, but the second one does not work.

There is some code under the next button;

Protected Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.NextButtonClick
If Wizard1.ActiveStepIndex = 1 Then
'some code here
end if
end sub

but it still breaks even if I comment out all the code or change the index from 1 to 2...

Thanks for reading this far, it was a bit of a long post.

Scott

you should go to your Internet Explorer's Internet Options and then go to the Advanced Tab. There you can check out 2 options: "Disable script debugging (IE)" and "Disable script debugging (other)".

Check these out and then debug. Then you can go into more detail about the javascript error.


the only extra i can add to the error message is this

Line: 104
Char: 5
Error: 'null' is null or not an object
Code: 0

I suspect that the javascript error is in the Update Panel, but im not sure...

Sorry.


Hey scott,

since nobody responded with something useful, ill give it a try ...

The error you are getting is very wide. This error can be thrown everytime an object isn't initialised at the moment you try to allocate a value to it.

because the error is so wide it's not easy for us to give a straight to the point answer.

You could try to strip down the problem into a demoProject which replicates the error so its very easy for everyone to follow what's going on.

Another thing you could do is look at the way your wizard runs through its pages. How is it set up? When creating wizards I would go for the multiview with serveral views in it for each wizardPage and then some buttons for the navigation. I made some sort of tabsControl with a multiview in an updatepanel and some navigation and all works fine :p

Good luck!


Thanks for the reply.

It gets weirder every time I look at it. In Mozilla FF it works fine; it seems only IE7 (not tried <6) stops me moving between the pages of the wizard control.

After what you said, a thought did occur to me, it stops on the page after the page containing two ajax calendar controls... but this was the wrong line of enquiry so i copied my script and progressivly removed parts until it started working.

I think this is caused by a common variable in the javascript between "something" and the required field validator control. I am using:

Modal Popup
Calendar Extender
Update Panel
and Required Field Validators

and it works fine when I remove all the validators.

I am a little behind schedule now, but I will try and recreate this on a new project later and if I get the same results with the error, it might be a small bug.

Thanks for the advice btw,

Scott M


I found out how to fix it, apparently its the required field validators use an old API to register their script !? there is a post on here somewhere (which I failed to find) that has a link to a recently compiled version of them which works flawlessly.

No comments:

Post a Comment