Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test of the model type
Message
From
24/12/2012 16:09:14
 
General information
Forum:
ASP.NET
Category:
MVC
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01560569
Message ID:
01560576
Views:
40
>
>@if (ViewData.ModelMetadata.ModelType.ToString()
>
>
>And I am not sure how to finish it. I want to test it against (first 3 chars to be Int or other numerical types (I guess I need to test for decimal)?

Are you talking about three sequential characters which are in the range 0..9, or a plus sign, minus sign, or decimal?

I don't know C#'s class and library functions very well, but in Java there is a String class function that is substr()-like. You can use this function to extract those three bytes and pass them to a test function which identifies if they're in the ASCII range '0' .. '9', or one of the other valid characters (+-.).

Don't know if this helps....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform