I am building an admin portal for a helpdesk. On one page I have a dropdown with a LinkButton, and another a dropdown with a Button. Both buttons redirect to the page they are clicked from by firing off a Response.Redirect()
, like so:
Response.Redirect(String.Format("article.aspx?action={0}", ActionDropDown.SelectedValue), False)
This allows me to use one page for multiple functions.
Anyway, the page that the LinkButton does NOT work on has a WYSIWYG editor, FCKeditor, in it and FireBug throws the following error when I click the LinkButton:
FCKeditorAPI is not defined
- WebForm_OnSubmit()()
- WebForm_OnSubmit()
- __doPostBack("ctl00$Content$LinkButton1", "")
- Sys$WebForms$PageRequestManager$_doPostBack("ctl00$Content$LinkButton1", "")
- (?)()()
- javascript:__doPostBack('ctl00$Content$LinkButton1','')
- var editor = FCKeditorAPI.GetInstance('ctl00_Content_NewArticleEditor');
No errors when I use a button. Any thoughts?
Javascript is NOT disabled in the client.
-
Not a full answer here, but a couple of things to check would be that you ensure JavaScript turned on on the client? (sounds like it from the error).
The most obvious thing to check would be what the button is actually doing on the click. Is it rendered as a submit button, or is it doing a postback?
Tundey : You mean javascript is turned off at the client.Martin Clarke : My instinct was that it is turned on. Because otherwise he wouldn't have got an error in FireBug. -
LinkButton uses javascript. Check that it's not turned off on the browser.
-
I think that it's because LinkButton is rendered into his own <form>, which is inherited in the FCKEdit, or maybe FCKeditor overrides it's form's onSubmit behaviour?
-
Generally, when a browser encounters a JavaScript error, all script after that point fails to work.
Is the FCK editor working as you expect it to? Are all the JavaScript files that it requires in place correctly? You can check this on the Scirpt tab of FireBug:
Select the Script tab, ensure that script is enabled, and then in the top row of FireBug, you should see something like:
Clicking on the page path allows you to inspect the other JS includes:
Check that each of the requested files isn't returning an error of some kind.
Finally, are you using the FCKEditor.Net wrapper to access the FCK Editor, or just the editor as it stands?
Anders : I am using the FCKeditor.Net wrapper
0 comments:
Post a Comment