.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

CompareValidator - double

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
<asp:CompareValidator ID="CompareValidatorAmountDepositMin" runat="server"        ErrorMessage="Znesek vplacila je premajhen!" ControlToValidate="AmountDeposit" Operator="GreaterThanEqual"        ValidationGroup="ErrormessageValidationGroup" ValueToCompare="1" Type="Double" Display="Dynamic">        <asp:Image ID="Image13" runat="server" ImageUrl="~/Images/warning.png" ImageAlign="TextTop" /></asp:CompareValidator><asp:CompareValidator ID="CompareValidatorAmountDepositMax" runat="server"        ErrorMessage="Znesek vplacila je prevelik!" ControlToValidate="AmountDeposit" Operator="LessThanEqual"        ValidationGroup="ErrormessageValidationGroup" ValueToCompare="10000" Type="Double" Display="Dynamic">        <asp:Image ID="Image14" runat="server" ImageUrl="~/Images/warning.png" ImageAlign="TextTop" /></asp:CompareValidator>The problem is that it does not work if I write "10.5

View Complete Post

More Related Resource Links

Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

Split List into sub lists of List of size n

Hi all,   I've been playing around for a little bit trying to find the best way of taking a List<double> of variable size and splitting it in to sub-lists of  size n. So maybe a method stub like   public List<List<double>> splitData(int width,List<double> data) { <br/> }<br/> The problem is i cant get my head around how to iterate through the parameter "data" properly when the data.count is not exactly divisible by the parameter "width". I have been trying for loops but i think i need to switch to do whiles.   I'm not massively familiar with LINQ but could anyone advise if LINQ would provide an alternative way of doing it?   Any help much appreciated   John

two adjacent double quotes in json causes blue screen by JavaScriptSerializer

Hello, I am using System.Web.Script.Serialization.JavaScriptSerializer to deserialize  http requests.  I get the blue screen when the contents I am deserializing has two double quotes, for example:  ""country"". Is there a fix for this?  Currently I replace the "" with a special string and then I deserialization, then I put back the "".  I do this for a given field in the object which I've seen comes in with ""s.  The problem is that I should be doing this for all fields in the input json.  This is a lot of extra code to write as I could be deserializing many different types of Json objects.  The "" is needed by the client to specify a quoted string, so I can't ask for the input to be changed. Any help on this subject would be really appreciated. Many thanks.     I am using .Net framework 3.5.

double.IsNaN throwing ArithmeticException

I have problem when calling double.IsNaN method. It is throwing an ArithmeticException. With a message like "Overflow or underflow in the arithmetic operation." Any ideas as to what is causing this problem?

double spin text in richtextbox

i want to implement this feature : if i have a following sentence : {my name is james vick and iam a {member|user|visitor} on this {forum|website|site} and iam loving it | iam admin and iam a {supervisor|admin|moderator} on this {forum|website|site} and iam loving it} on a click of button i want to generate this : my name is james vick and iam a member on this site and iam loving it or iam admin and iam a admin on this forum and iam loving it The basic need is to randomly choose words between {|} braces I have been able to do this for inner nest i.e. for {member|user|visitor}. But how to include the outer nest of sentences also i.e. {something blah blah {blah1|blah2} and | something else} ? code for inner nest : Private Sub SimpleButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton3.Click Dim stringWithTextIn As String = RichTextBox1.Text Dim regex As New Regex("{(.*?)}") Dim r As String = regex.Replace(stringWithTextIn, New MatchEvaluator(AddressOf ReplaceMatch)) RichTextBox2.Text = r End Sub Private Function ReplaceMatch(ByVal m As Match) As String Dim parts = m.Groups(1).Value.Split("|"c) Return parts(r.Next(0, parts.Length)) End Function i know i just have to change the regex but what do i add in it to include outer braces?

bug: subtract value from double returns invalid value!

Dim b as double  = 0.8 Dim a as double = 1 - b a contains the value 0.1999999996 in stead of 0.2 ???????????????????

String StartWith double quote

hi all,my string variable first character starts with " now i want to check whether it has " or not. how to check this from Code Behind.

Double hop delegation problem

Hi,I have an ASP.NET 2.0 web app which calls a one way web method on a web service. This web method contacts remote servers and pulls back config information to confirm the state of new server builds (settings etc) and inserts the collected data into a SQL database. The web app is supposed to pass through the callers kerberos ticket to the web service and then again to the newly built server which is being checked, all via impersonation and delegation using the calling users administrator privileges.The trouble is, I just can't get the web service to run under the callers context. I have the SPN's set up, delegation turned on in the active directory objects for the computer running the web app and service and the worker process domain user service account. I have windows authentication on and impersonation set to true in both the web app and service's web.config, integrated authentication in IIS, and IE settings are all ok. All has been checked out and passes the tests in DelegConfig, but it still won't work.It appears that any data that's is written to the database is written under the context of the web pool service account, and not the calling users, plus along with the fact that I get access denied messages when trying to collect data from the server says impersonation isn't working.Also, is it possible to run the checks under the calling users

How to pass double pointers for COM Interop via MethodInfo.Invoke ?

Hello, I need to make COM IntetrOp at runtime using reflections. My native COM Object's exposed methods have some parameters as pointers (DWORD*) and some double pointers (DWORD**) and some are user defined types(e.g SomeUDTType objSmeUDTType) and its pointer to pointer(i.e. SomeUDTType **pSomeUDTType). I need to pass pointers to pointers. For now how can I be able to populate "object" array as pointers to pointers of SomeUDTType. Working Example:      STDMETHODIMP MyCallableMethod(DWORD *value_1,BSTR *bstrName,WESContext **a_wesContext tlbImp.exe generated output:      DTINIDLLib.RuntimeCallingClass.MyCallableMethod(ref uint, ref string, System.IntrPtr) Regards UsmanMutlithreading

How to prevent combobox drop down from expanding on double click

Hi, I have a requirment to toggle the selected item of a combobox on double click. I am able to achieve this using MouseDoubleClick event for combobox. But the issue is, when I double click the popup for the combobox also drops down, which I need to avoid.   How can I do this.   Please help.   Thanks, P

ListSearchExtender causing double postback when alert() or confirm() is called within PageRequestMan

This is a weird one.   I'm trying to implement a confirmation dialog before an async postback.  The idea is to use the JavaScript confirm() function to allow the user to cancel the postback.  I'm implementing it this way because my page has a bunch of different controls that might trigger an async postback inside an UpdatePanel.  Some of these are Ajax Control Toolkit controls like the ComboBox.  Rather than trying to trap the DOM event that triggers postback for each of these controls, it's easier to write one function and attach it to the client side initializeRequest event of the PageRequestManager, calling set_Cancel(true) or abortPostBack() if the user does not confirm.  This function can also be a central place to undo any changes if the user does not confirm.The problem is that the act of popping up the confirm dialog causes the UpdatePanel to postback twice, but only when the triggering control is a DropDownList (with AutoPostBack enabled, of course) with a ListSearchExtender.  If I replace the confirm() with alert(), the same thing happens.  If I comment out the alert, the problem goes away.  Below is a stripped-down page to reproduce the issue.  (I tested with IE 8/FF 3.5, and also tried both the new ASP.NET Ajax Library Beta 0911 and the old AJAX Control Toolkit Version 3.0.30930.)<%@ Page Language

Passing Double Value to Function

Hi all,The scenario is this:I have a .aspx webform, with code behind to handle data entered by user, most fields are in double.At business layer, at other class, let say there is a function: public SaveData(value1 As double, value2 As double) as BooleanThus, when I call the function at code behind:SaveData(txtDouble.txt, txtDouble2.txt)The problem is when there is a empty text, it will throw an exception invalid cast to double value.Thus, I should change it to:Double value1 = 0.0 Double value2 = 0.0 double.TryParse(txtDouble.txt, out value1) double.TryParse(txtDouble2.txt, out value2) SaveData(value1, value2) I just wondering whether this is the correct way of writing it? And if I have more than 20 fields of double value, then I should declare additional 20 double value?Your input is much appreciated.Cheers!

NullReferenceException in ReHosted Designer on double-click

Hi,   I have a WinForms application with a rehosted workflow designer (WF4) and although my xamlx workflow opens in the designer without error, I find that when I drill down into the SendReceive activities I get a NullReferenceException as follows: NullReferenceException: Object reference not set to an instance of an object, at System.Activities.Core.Presentation.FlowchartDesigner.CleanupFlowchart() at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)... I'm running on Windows 7 x64. Any help with this would be hugely appreciated. Thanks, Stuart  

OpenDialog box to open file with a double-mouse click

Hi, I am having a hard time trying to find an example that opens an opendialog box and allows the users to open the file with a Double-Click. Please help.   Thanks

How to convert string to double

Hello All!! Since I am pretty new to C sharp I am unable to solve simple conversion from string to double. Example would be like this: string sVal = "-7.0"; //This is negative number. double dVal = 0.0; Now I need to assign dVal with value from sVal and I did try those examples but none of them worked. dVal = double.parse(sval); nor it worked this way dVal = System.Convert.ToDouble(sVal); Please advise what am I doing wrong and how should I solve this pretty simple problem. Thanks in advance.

how to double quote a control?

 How would I put quotes on the DataLink control so it outputs "\ \computer\folder" (i put a space in there between the \\ so it would show up) instead of just \\computer\folder   it generates a link but if the folder name has a space it in the link breaks so i am trying to put double quotes on it so it creates a link even if there are spaces.  Dim DataLink As New TextBox DataLink = FormViewDC1.FindControl("CDR_Data_LinkTextBox") mail.Body = "Your CDR ID#" & cdrID.Text & " status has been updated to: " & Status.Text & "<br /><br />" & "Data Location:<br />" & DataLink.Text & "<br /><br />" & "Comments:<br />" & Comments.Text & "<br /><br />This is an automatically generated email, please do not reply."  

Activity/State mouse double click

Hi, When I double click activity/state, the workflow designer sets that activity/state as root designer. Is there a way to  disable this behavior? Thank you
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend