Preventing CheckBoxList DataSource from rendering HTML - vb.net

I am using a CheckBoxList in a VB.NET web project. The elements are pulled from a DataSource which is populated elsewhere in the system.
The problem is, if someone put in some raw HTML, the CheckBoxList seems to render it rather than assume plain text.
In this screenshot, for example, I entered hover here so now whenever you hover over that CheckBox, an alert window pops up. This seems like a potential for XSS and I would like to disable it altogether.
I have tried googling and searching SO for someway to disable HTML rendering such as this, but haven't found anything relevant, so my apologies if this already has been answered elsewhere.
Thanks!

After binding the datasource, you should be able to iterate through each of the Items in the CheckboxList and use System.Web.HttpServerUtility.HtmlEncode to update each item's Text property.

Related

Cocoa Bindings with NSComboBox

I have Cocoa Bindings working with a NSComboBox that shows and autocompletes values based on a Managed Object Context. My issue is trying to get the current selection after the user either selects from the dropdown or the autocomplete text is used. I know that the Array Controller class has a selected objects property, but when I try to use it to pull out the selected object I get nothing. With a NSComboBox do I have to set the selection once the text/selection of the combo box occurs or is there something I'm missing setting up the Array Controller.
Thanks
A combo box allows any arbitrary string to be entered, right? (You're not limited to the items you can autocomplete, unlike a popup menu.) So it doesn't have a concept of selected item, since the text in it might not correspond to any item in your database.
This question seems to address a similar issue, declaring it to be unsolvable using only bindings, and links to a blog post that has some hints on what code needs to be added. The gist of it is that, when the user finishes editing the combo box, you create your own fetch request in code and use the response from that to link up the model.

Refresh Element in QML

I have a RadioButton in my QML Desktop Application, and when I set it to unchecked, It really becomes unchecked, but I can't see that untill it contains mouse. I tried a lot of ways to resolve it, and didn't find any good one. so I decided to refresh the page, or even just thr RadioButton, in order to set the RadioButton to it's really state, and I hope that after the refreshing the button will be shown as unchecked one.
Do you have any idea how to refresh or reload it? Thanks ahead!!
Seems you just got bitten by a bug the QML components for the desktop (or what kind of radio button component you are using?). Not overly surprising, this is still unreleased code not intended for production use.
Refreshing the radio button as in unload it and reload it just after that is possible with the help of the Loader element. Just clear the source attribute temporarily.

Removing item level mouseover effect in SharePoint 2010

I am trying to remove the hover effect that brings up the checkbox next to the row item in SharePoint 2010 list item rows. Is there any settings that can make this happen? I would like to keep away from having to tinker with the CSS and javascripts. Please see illustration below. Thank you.
There are no settings for that sort of thing - the selection check box is a default behavior. You are going to have to modify the CSS, for that.
Use SharePoint Designer (Available Here]1) to help determine whitch CSS elements control that behavior, and make a custom style sheet to override it.
You can accomplish this by going to the Modify View option of your list and unchecking the Allow Individual Item Checkboxes under Tabular View options.
Note: If you are using a Web Part to view it you might have to set the view again for the changes to reflect.

How to edit Expression Blend selected control part?

I am trying to edit a specific control part within a custom TabItem Template. In this case, it's the TemplateBottomSelected control part.
I'm having an issue where I cannot seem to view or edit any control parts within the template editor except the default TemplateTopSelected. Here's a screenshot of what I'm talking about:
Even though I'm selecting the "TemplateBottomSelected" grid, the only thing I can see is the template for the TemplateTopSelected item.
How the heck do I edit the other control parts within the template using the editor?
Thanks!
that's because these templates are either collapsed or the opacity of them is set to 0. :)
you can use the eye toggle button to only show the one you want to modify at design time, set the visibility to visible, do your changes, and reset it to collapsed.
please let me know if you need more info.

vb.net How to make a DropDownList with readonly appearance

I am developing desktop application using vb.net and vs2008.
I have a DropDownList that I don't want it interact with use when the info is locked.
But if I disable it, it is greyed out and the text is not easy to read.
Is there any way to make radiobutton like readonly textbox?
I want text of the DropDownList looks black and itself is not clickable.
The above shows a disabled DropDownList with greyed out text and a readonly textbox
Try this:
Enable="false"
Place it within your <asp:DropDownList> tag.
I recently encountered a similar issue. My solution was to remove all other values of the DropDownList except the one that is selected. This will keep the text as black as opposed to grey. Users will be able see the existing value and click it but will not be able to change it.
Hope this helps.
No, you can't use CSS in a desktop app. When you disable the dropdownlist by setting Disabled=true; or Enabled=false (whatever the case is), you can also change the Font properties to make it easier to read. You can set other properties such as Border, BorderStyle, etc, etc.
Keep the control enabled. In the GOTFOCUS event, use SENDKEYS to send a {tab} to the form. the user will not be able to change it! By the way, workt for ALL controls, that a user can focus.