Simple yet important 4 questions about Visual Basic Studio 2012? - visual-studio-2010

Guys I'm a student who knows simple stuff about Visual Basic Studio 2012 and who's working on creating an application for a course project. :)
I'm using ASP.Net Empty Website under Visual C#
If that makes sense. xD
Anyways, I have 4 important yet simple questions:
Q1: how do I apply Password Custom Vlaidation? For example 8 characters min in both the password and the password confirm text feild?
Q2: How do I apply "required" validation to a group of radio buttons, check boxes and a drop down list?
Q3: In a form, how do I get a list of radio buttons appear as options for once a customer picks a hair style category, however if she picks a make up categorty from the same drop down list, a whole different options appear? I hope it's clear lol
Q4: Is there a "range" tool in Visual Basic 2012 and how do I use it?
I appreciate every answer and so much thanks in advance. :D

For ASP.NET
Ans1:
Use RegularExpressionValidator instead of CustomValidator
Ans2:
Use RequiredFieldValidator with all the controls. And in the last use single ValidationSummary Control to display message. Here is link for you Understanding ASP.NET Validation Techniques
Ans3:
Use RadioButtonList control for options.
On SelectedIndexChange event of DropdownList control populate the RadioButtonList with relevant options.
Ans4:
Link in Ans2 will give you the RangeValidator control example.

I assume you are working in Winform.
And Since I am a C# developer I am posting my code in C#. you can use Telerik Code Converter to convert it to VB.NET
Ans1:
char[] charArray = s.ToCharArray();
int passwordCharacters = charArray.Length;
if (passwordCharacters < 8)
{
//Your code
}
Ans2:
Use ErrorProvider Control
Ans3:
There is no data bound RadioButtonList control in Winform. You will have to do it manually.
Ans4:
I don't think so there is any ASP.NET like Range Validator Control in VB.NET

Related

Show/Hide CRM controls malfunctioning

I am setting the section properties of CRM form to have label & control in separate rows like below:
By default the form control will be visible=false. When I try the below snippets only label is showing up but not the textbox. If I use side by side setting, its working as expected.
Xrm.Page.getControl("myattribute").setVisible(true);
or
Xrm.Page.ui.controls.get('myattribute').setVisible(true);
Can I achieve this by some other supported means?
Update:
Ours is CRM 2015 on-premise. Not update 1.
I have tested the same behavior in Dynamics 365 CRM trial. Legacy form behaves the same way, but Turbo form is having the fix.
Can you please try the following options and check if the issue persists ?
1. Turn off legacy form rendering.
2. If you can use the Business Rules, to Show/Hide field and see if it works ?
3. You can use un-supported customization, to hide the textbox.
var curElement = document.getElementById(controlname + "_d");
if (curElement != null)
curElement.style.display = '';
This seems to be Product bug till date, even in latest version with legacy form.
For now as a workaround, we are keeping the controls in separate section to meet our need.
Am open to any other supported solution.

NSIS Uninstall Feedback Dialog with Radio Buttons

I am trying to show a simple dialog before uninstall in NSIS. It consists of several predefined radio buttons (reasons for uninstalling), none of them checked initially. Uninstallation cannot continue until a user selects one of the radio buttons.
As a bonus, ideally I would like to have a custom reason text field too (toggle-able via last radio button). As well as 2 more text fields for custom text and email.
Then I need to take selected value(s) (checked radio button) as well as text fields data and either append it to my predefined URL to which I make a GET request using InetC or similar plugin before uninstaller exits; or laternatively construct a POST request to a predefined URL using InetC or similar plugin. I cannot figure out how to create such a dialog page. Any help would be appreciated.
What I am looking for:
First, you should get familiar with nsDialogs to create the interface according to your needs. Since nsDialogs is a function, you would then can call it as a custom page.
You can use my tool Visual & Installer (www.visual-installer.com) for Visual Studio 2005 - 2015 to fast write the NSIS code.
(If you are "writing" the installer - I assume you have some experiences with nsDialogs).
Also there are some other tools like NSIS Dialog Designer (http://forums.winamp.com/showthread.php?t=329801) which can help you and generate lot of code for you.
This tool is GUI based - designer similar to Visual Studio designer - but remember: the result is still the scripts!

Dynamics CRM option set

I am new to Dynamics CRM so please excuse me for the newbie question xD
I managed to create an option set field with 2 possibilities:
Scheme 1
Scheme 2
Does anyone have an idea how when a particular possibility is picked, a list of custom based fields will appear in the form? Thanks in advance
If i understand your problem correctly you want certain fields to appear/disappear according to the choice selected in the option set.
The way I see this working is by implementing a Javascript on the onChange event of the option set. you can do this from the 'Form Properties' when changing the layout of the form.
Below is a link showing some examples of possible useful commands that might help you:
http://www.powerobjects.com/blog/2011/01/14/crm-2011-useful-javascript-tidbits/
You can put your custom fields in a custom tab and then hide/disable it according to the value in the option set.
If you have any further problems feel free to ask :)
I hope this helps :)
Gdluck
If you are comfortable working in Visual Studio, I highly recommend installing the Developer Toolkit (You can find the .msi \tools\developertoolkit - download it from here). It will allow you to develop JScript with some syntax highlighting and intellisense and makes source control and deployment a snap.

extending #Html.DropDownList mvc3

In my continuing effort to build out my form validation controls, I've gotten to the dropdownlist control and ran into a snag when I tried to customize this one.
I've tried using the TagBuilder and a simple String in extension methods to extend this control but when I try to "bind" it to a list on the back end, it's not actually binding any data to my dropdownlist. I'm sure I'm missing something (IEnumerable or the like) on my custom control but I have no idea what....any suggestions (code samples would be terrific) would be awesome.
thanks
You can go through the ASP.NET MVC source and get an idea as to how it is implemented.
Go through the License as well!!

Custom controls in Visual Studio Lightswitch

Can someone point me to an article or tutorial on using custom controls in Visual Studio Lightswitch? I'm trying to add a rich text box to a page, linked to a string property. When running the app, sometimes the field will show up, sometimes it won't. If it does show the width of the field is small, about 2 characters, but will expand when text is pasted inside. Saving doesn't work, though.
I'm not even sure about whether or not I'm allowed to use controls like these in a Lightswitch app, even though custom controls are obviously supported. Are the custom controls restricted to a certain type or set?
Thanks in advance for any assistance.
W.
Have a look at the following example, http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/10/LightSwitch-Student-Information-System-Part-3-Custom-Controls.aspx
Also the Training Kit has examples of Custome Controls included.
There is also this tutorial:
Creating A LightSwitch Custom Silverlight Control
http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/2/Creating-A-LightSwitch-Custom-Silverlight-Control.aspx

Resources