HI. I'm testing Radinputmanager.
I want to print dropdownlist1's index without radinputmanger's validation at client-side.
i expected i clicked the "print selectedIndex" button,it printing dropdownlist1's index
and if i click the "Print Result" button, it works validation to textboxes.
but result was raise the textboxes validation.
help me.
My source is
and code behind is
I want to print dropdownlist1's index without radinputmanger's validation at client-side.
i expected i clicked the "print selectedIndex" button,it printing dropdownlist1's index
and if i click the "Print Result" button, it works validation to textboxes.
but result was raise the textboxes validation.
help me.
My source is
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="RadControlsWebApp8._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
id
=
"Head1"
runat
=
"server"
>
<
title
></
title
>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=utf-8"
/>
<
meta
http-equiv
=
"expires"
content
=
"-1"
/>
<
meta
http-equiv
=
"pragma"
content
=
"no-cache"
/>
<
link
href
=
"./main.css"
rel
=
"Stylesheet"
type
=
"text/css"
/>
</
head
>
<
body
>
<
form
id
=
"frmMain"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
OutputCompression
=
"Disabled"
>
<
Scripts
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
</
telerik:RadAjaxManager
>
<
div
id
=
"divContents"
>
<
table
style
=
"width: 800px; text-align: center; margin: 0 auto;"
>
<
tr
>
<
td
colspan
=
"2"
style
=
"width: 800px"
>
<
asp:DropDownList
ID
=
"DropDownList1"
runat
=
"server"
>
</
asp:DropDownList
>
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"2"
style
=
"width: 100%;"
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Print SelectedIndex"
/>
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"2"
style
=
"width: 800px"
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
></
asp:Label
>
</
td
>
</
tr
>
</
table
>
<
table
style
=
"width: 800px; text-align: center; margin: 0 auto;"
>
<
tr
>
<
td
colspan
=
"2"
style
=
"width: 800px;"
>
<
h2
>
Input Manager Control</
h2
>
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"tdLeftContent"
>
Numbers Only
</
td
>
<
td
class
=
"tdRightcontent"
>
<
asp:TextBox
ID
=
"TextBox1"
runat
=
"server"
></
asp:TextBox
>
ex) 12345679
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"tdLeftContent"
>
Currency
</
td
>
<
td
class
=
"tdRightcontent"
>
<
asp:TextBox
ID
=
"TextBox2"
runat
=
"server"
></
asp:TextBox
>
ex) 79.90
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"2"
>
<
asp:Button
ID
=
"Button2"
runat
=
"server"
Text
=
"Print Result"
/>
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"2"
style
=
"text-align: left; padding-left: 200px;"
>
<
asp:Label
ID
=
"Label2"
runat
=
"server"
Text
=
"Label"
Visible
=
"False"
></
asp:Label
><
br
/>
</
td
>
</
tr
>
</
table
>
</
div
>
<
telerik:RadInputManager
ID
=
"RadInputManager1"
runat
=
"server"
>
<
telerik:NumericTextBoxSetting
BehaviorID
=
"NumericBehavior1"
EmptyMessage
=
"type here"
ErrorMessage
=
"Numbers Only"
DecimalDigits
=
"0"
Culture
=
"en-us"
Type
=
"Number"
Validation-IsRequired
=
"true"
>
<
TargetControls
>
<
telerik:TargetInput
ControlID
=
"TextBox1"
/>
</
TargetControls
>
</
telerik:NumericTextBoxSetting
>
<
telerik:NumericTextBoxSetting
BehaviorID
=
"NumericBehavior2"
EmptyMessage
=
"type here"
ErrorMessage
=
"Numbers Only"
DecimalDigits
=
"0"
Culture
=
"en-us"
Type
=
"Currency"
Validation-IsRequired
=
"true"
>
<
TargetControls
>
<
telerik:TargetInput
ControlID
=
"TextBox2"
/>
</
TargetControls
>
</
telerik:NumericTextBoxSetting
>
</
telerik:RadInputManager
>
</
form
>
</
body
>
</
html
>
and code behind is
Imports Telerik.Web.UI
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If (DropDownList1.Items.Count = 0) Then
Dim listItemDummy As New ListItem
listItemDummy.Value = ""
listItemDummy.Text = ""
DropDownList1.Items.Add(listItemDummy)
For i As Integer = 0 To 10
Dim listItem As New ListItem()
listItem.Text = (i + 1)
listItem.Value = (i + 1)
DropDownList1.Items.Add(listItem)
Next
End If
End Sub
Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim dropDownListIndex As String = DropDownList1.SelectedIndex.ToString()
Label2.Text = TextBox1.Text + " AND " + TextBox2.Text
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim dropDownListIndex As String = DropDownList1.SelectedIndex.ToString()
Label1.Text = "SelectedIndex: " + dropDownListIndex
End Sub
End Class