You may ask what if I want to do some thing with the Textbox
that is not supported as a property, like settings the English Textbox as a
Default focus. Fortunately, if you look at listing 11, there is a read-only
property that gives me the ID for the English Textbox, so you can search about
the Textbox on the page using that property and you can add more styles and
more attributes to the Textbox.
Note the Browsable(False)
attribute placed above the property, it means that the property will not appear
in the properties window or in the html design time, you can access it from
code behind only.
Description("ID of English TextBox.") _
Public ReadOnly Property EnglishTextBoxID() As String
As you can see in Listing 12, I set the English Textbox as
Default Focus. You can reform the Textbox as you want; I have changed the back
color for the Arabic Textbox into Blue.
'//Set English Textbox as DefaultFocus
Page.Form.DefaultFocus = _
DirectCast(MultiLang1.FindControl(MultiLang1.ArabicTextBoxID), TextBox).BackColor = _
What about client-side validation. Suppose that the French
function, and call it in the button event OnClientClick.
assigned to the passed arguments.
One of these variables is “this.imgFrId.”
It is the ClientID for the French Image and we have passed it via the script
block during render time.
It is the object from the French Textbox. As you can see in listing 13, we are
passing the ClientID for the French Image to the “HideShowLang()”
function, which is the responsible for sliding the contents.
The “HideShowLang()” function
receive the Image ClientID for the content you want to Slide it down. So, for
sliding down the French div, we should pass the ClientID for the French Image,
so the French div will slide down and the other languages div’s will slide up.
alert('Please Enter Text in French');