When I use a RadEditor I want to enable the editor's spell check (working thus far). After a spell check the user can either click on the radmodule (toolbar thing) to either "finish spellcheck" or "cancel." Which is all fine and dandy except the "finish" button causes a postback!! I don't want that at this point!! "cancel" more or less does what I want to happen - I mostly just want a "done" or a way to stop the postback. Does anyone have any clues?
I've tried an Update panel but that just grays out the text area after it does the update.
The "finish" button should not do a postback - verify this by going to the Telerik online demos - http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx If it does postback, then there is a problem with some JS code on the page or some customization you did on the editor. Try starting with a blank editor page in your project and see if the behavior changes.
I think its cause we have a relatively old version of Rad now... Talked to my boss about buying new licenses..
Related
I have a curious issue. I have an ASP.NET web page that has a RadioButtonList with three RadioButtons. RadioButton1 hides both Panels. RadioButton2 displays Panel1 and hides Panel2 then RadioButton3 hides Panel1 and displays Panel2. Pretty straight forward. All of the logic that hide and display the Panels is in C# in the Code Behind. All of this works great in Chrome and IE. In Firefox; however, if you refresh the page in any way (another controls posts back or by hitting the browser's refresh button) while say RadioButton2 is selected and Panel1 is displayed the page comes back with the RadioButton2 still selected but both Panels are now hidden. In Chrome and IE a refresh of the page brings it back to it's original state. Meaning that all of the controls are set to their original values and RadioButton1 is selected and both Panels are hidden. Not necessarily ideal but a whole lot better than having the RadioButtons and Panels come back out of sync.
Not sure where to begin looking on this one. None of this is done in JavaScript. The panels and RadioButtons are not generated in code behind they are in the static HTML portion of the page.
Thoughts?
This sounds like you might be dealing with a page caching issue in Firefox. Have you tried disabling page caching for this page? For example, see this answer: Disable caching in Fire Fox in ASP.NET and C#
This is not really the answer I was hoping for because it seems incomprehensible to me that in 2014 we still have issues with browser inconsistencies but I put some code in the page to handle this and force it back into the proper state. This has solved the immediate problem.
I have a problem where I have a page with a kind of coupon that should change given several different button presses.
However, in one case, it seems that I am unable to click a specific button without adding a sleep between finding the element and pressing the button.
non working code:
element = page.find("[for='someButton']"])
element.click()
working code:
element = page.find("[for='someButton']"])
sleep 2
element.click()
I am wondering if there is anything I can do to remedy this issue without having to add a sleep, as I fear this makes my test more brittle as well as causing an unnecessary delay
PS.
No errors are being thrown and I did not write the web-application myself. I did however talk to the one who implemented this page and he said that there should not be anything special about this one button and that it should have it's event listener added as soon as the page loads
This could happen if the button is rendered in the DOM before the click event handler is bound. Capybara will be able to find the element as soon as it's in the DOM.
If this is the case, the tests are actually showing you that there is a (minor) bug. A real end user that clicked the button while the page is still loading would see the same result. A cleaner option would be to render the button via JavaScript and bind the click handler at the same time.
If changing the page isn't an option for you, there may still be hope. If there is something else on the page that is rendered by JavaScript in the same iteration of the event loop, you could add something to the test that looks for that before trying to click the button. For example, in the app I work on at my day job, we render an animated spinner GIF on the page when it loads, and then hide in in JavaScript when the page is fully loaded. Our Capybara tests wait for the spinner GIF to be hidden before interacting with the page.
I have a page that if IsPostBack is true, calls a javascript function which gets the size of the screen, passes the width and height to hidden fields and clicks a button to cause a PostBack. So I can retrieve the size of the user's screen and then load the page with default data with tables the right size etc.
Invariably, when the page (having posted back once) displays the data, a gridview is populated. Each row has a 'delete' Link Button in it. Each Link Button is set OnClientClick to call a javascript function to confirm you want to delete.
Above the grid is a row of text boxes / buttons / dropdownlists which allow you to search for, or filter the data showing. The Gridview is in an update panel. When the page first loads its data, and shows the list of projects, the delete Link Buttons all work okay. In every row, no problem. The Confirm box is displayed and, if Okay is selected, the asynchronous postback occurs.
If, after the initial data is displayed (which is already after one postback) you then use the search box and button, or use a dropdownlist to filter the data (the Search button and filter DropDownList are async triggers for the UpdatePanel) the data refreshes okay (always) but, then, sometimes, the 'delete' LinkButton in each row of the GridView does nothing. It doesn't even fire the ClientSide function. It's as if it is dead.
I had a similar problem a while ago with ImageButtons and the received wisdom seems to be 'change them to LinkButtons'. But I have dozens of grids with 'delete' LinkButtons that work okay, but this one has decided to stop working - sometimes.
I have to say, since moving to Framework 4.0, I'm thinking of giving up on UpdatePanels. Seem to have nothing but problems with sites that worked reliably for years in Framework 2.0
Any ideas please? Is this anything to do with the order in which controls are loaded on the second postbacks?
Edit: There is a twist to this. When this situation occurs, i.e. clicking on the Delete link does not even trigger the Client Side event - if you click on an area of the page outside the Gridview (i.e. outside the UpdatePanel) - and then click back on the Delete link - it works!
Regarding ImageButtons: There is a bug with IE10: ASP.NET fails to detect IE10 causing _doPostBack is undefined JavaScript error or maintain FF5 scrollbar position ( http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx ). Just upgrade to .NET 4.5.
Regarding LinkButtons: Do you have "ID" property? I remember I had a similar issue because my linkButton didn't have an ID.
Could you post some code? It would help.
So I have a radiobuttonlist inside an updatepanel. I seem to be hitting a really simple yet vexing problem -
Even though I've set AutoPostBack=true, when I click on a radio button, I see the postback happen but the SelectedIndexChanged event does not fire at all. Not only that, even in the postback, when I check SelectedIndex it shows -1 instead of the button I clicked.
this is so annoying and I don't know what I'm doing wrong. It's plain and simple postback and server side processing to know which radio button in the list got clicked, there is nothing fancy in the code on either the server or client sides.
Please help!
(PS - I tried with/without adding the rbList control and the SelectedIndexChanged as triggers for the update panel and it still doesn't work..the SelectedIndexChanged does not fire)
Try testing it outside the UpdatePanel to see if in a non-ajax situation it does fire. Maybe your mistake is somewhere else.
OK, I don't know what the deal was - but I fixed it. Perhaps some others facing similar issues will find it helpful.
I was modifying the text property of the rbList,
e.g. rbList.Items[0].Text = "xxx"
and for whatever reason, this will killing the overall functionality. So finally I figured that this piece of code was causing issues, so I replaced it with
rbList.Items.Add(text,value)
and it started working, Also note that when I had rbList.Items.Add(text), it was causing problems as well!
no idea - but whatever, it fixed it.
I have one aspx page that has two UserControls on it; each is primarily a ModalPopupExtender. One has validators; one does not. The one that does not has a Submit button with the CausesValidation="false" attribute on it.
When that Submit button is clicked, nothing happens. Click it again, and the postback happens as expected. There is clearly some validation issue going on here, because if I remove all validators from the page, the postback succeeds on the first click.
What's going on here?
Without seeing the code, I can't say this for certain, but it sounds like you may need to utilize the validation groups. The validation group would be set on the validation components as well as the button that posts back the page.
Make sure that the buttons that show the ModalPopups are marked CausesValidation=false as well. What was happening was that the "Show Dialog" button for the non-validating dialog was not marked this way; this was causing the entire page to validate when that dialog was shown - including the other dialog, which did have validation and was failing it. This caused the Submit button to fail for apparently no reason.
Moral of the story: Make sure to use CausesValidation on any buttons that don't require it, and use Validation Groups to separate out various page parts, especially when parts of the page are not visible.
Have you tried removing the OK button property from the modal popup?