problem with range validator maximim value

Posted by Krishnamanohar under ASP.NET on 5/20/2014 | Points: 10 | Views : 1135 | Status : [Member] | Replies : 1
Hi experts,
i am setting my range validator maximum value in page load like this

Dim maxValue As Integer = 4
checking some conditions to put the some value in maxvalue variable
Me.rangeValidator1.MaximumValue = maxValue
Me.rangeValidator1.ErrorMessage = "Number must range between 1 to " + Convert.ToString(maxValue)

the loop is gooing to condtions and setting some value in maxvalue variable
but i am getting the below error

The value '' of the MaximumValue property of 'rangeValidator1' cannot be converted to type 'Integer'.

Please help me on the above issue immedeatly
Thanks in advance


Posted by: Raja_89 on: 5/30/2014 [Member] Starter | Points: 25

Hai Krishna Manohar's

Dim maxvala As String = 4

Me.RangeValidator1.MaximumValue = maxvala

In your code I've just changed int to string
It accepts only string value

If this is correct one Mark it as answer .


Krishnamanohar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response