C# Validation control - asp.net-3.5

Is it possible to use asp:RequiredFieldValidator and asp:RegularExpressionValidator for a single textbox.

yes. Just put them both on your page and set their controlToValidate to the same control

Yes you can, just bind both to the same TextBox/whatever control you want to validate.

Related

VB6 - Disable drop into webbrowser control

Create a form with a webbrowser control.
Drag and drop a txt/html file into the webbrowser.
The file is shown into the browser.
How do I prevent that?
The WebBrowser control has a property: RegisterAsDropTarget. Set it to false.
You can get a little more info on the property (and other properties) here.
If you want to disable drag-and-drop you should be able to set AllowBrowserDrop to "False".

Metro Style Apps Two way Binding with XML

Can I do two way binding with an XML document in metro style apps (using WPF/C#)? I want my XML file to get updated as soon as I make a change on the UI
Sure. After update invoke your method that will update your xml file. It won`t work automaticly, you need to manage this yourself
You are asking about XAML's Mode=TwoWay binding (default is Mode=OneWay), but I think you really mean UpdateSourceTrigger=PropertyChanged (as in WPF) which in WinRT is a bit of a trick. Answer is here: “UpdateSourceTrigger=PropertyChanged” equivalent for a TextBox in WinRT-XAML
may be u can call the saveXML() method on 'textChanged' event of the textboxes or any other UI controls of your metro app...

GWT ValueListBox: can it support more than a single selection?

Can GWT's ValueListBox support multiple selections? Also, is there a way to get it to display more than a single value at a time (like ListBox.setVisibleItemCount()) ?
It seems like you'd need to get at the underlying ListBox (or somehow provide a custom one) in order to make this happen. Of course getListBox() is private, so that's out.
No. ValueListBox is intended to operate on single value. That's why it can be easily used as editor (from Editor framework) for wrapped type.
For multiple selection you can use ListBox, but AFAIK there's no straightforward way to use it as editor (you have to write your own custom editor based on ListBox).

TinyMCE editor disable

How can I disable tinyMCE?
I'm not trying to make tinyMCE not exist, just trying to disable the field temporarily using PrototypeJS's Form.disable.
Is there a particular way to mark a field disabled for editing?
One option is to use the plugin 'noneditable'
Or you could investigate the 'mode: exact' setting and only setting it on the exact id of the form field you want to control.
Your use case isn't really clear, so hope the above tips work.

How do you programatically remove (not disable) a button from TinyMCE?

I can disable the table button using this:
tinyMCE.activeEditor.controlManager.get('divId_table').setDisabled(true)
but what I'm interested in is actually hiding it. Any idea on how to accomplish that?
Thank you!
First, you have to use the advanced theme.
Then, add this option in the TinyMCE init code.
tinyMCE.init({
...
theme_advanced_disable : "bold, justifyleft, justifyright"
});
I hope this might help someone.
source
list of elements' name here
I'm not familiar with TinyMCE myself, but since you appear to have javascript access to the element itself, all you need to do is set it's display property to "none".
document.getElementById("theButton").style.display = "none";
incase ur trying to hide a specific button, use the following code.
$('.mce_cut').hide() //hides cut button
lookup other button titles using firebug in case u wish to hide something specific.
Incase you are looking to hide specific editor's button, modifiy the jquery selector to select correct sibling/descendent.
alternately, try this ..
tinyMCE.activeEditor.controlManager.controls.ctl00_SPWebPartManager1_g_5005db96_e035_4197_a958_75f008b35061_ctl00_tbKeywords_cut.remove()
Note that ctl00_SPWebPartManager1_g_5005db96_e035_4197_a958_75f008b35061_ctl00_tbKeywords is my asp.net control's id. Don't bother about this if ur not using Asp.net serverside textbox control. In case you are.. <% theTextBoxID.ClientID %> gets u that.
Use the following (using jQuery; a non-jQuery approch is easily built):
var elem = $(ed.id+'_'+'divId_table')
elem.addClass('mceButtonDisabled');
elem.removeClass('mceButtonEnabled');