Processing
Showing posts with label C #. Show all posts
Showing posts with label C #. Show all posts
Tuesday, September 12, 2017
Wednesday, August 27, 2014
Tuesday, April 2, 2013
Namespaces for .Net Fucntionality
1. Going to use upload functionality the use the namespace
using System.IO;
if (!System.IO.File.Exists(fileToUpload))
throw new FileNotFoundException("File not found.", fileToUpload);
Otherwise it throws error
----------------------------------------------------------------------------------------------------------------
using System.IO;
if (!System.IO.File.Exists(fileToUpload))
throw new FileNotFoundException("File not found.", fileToUpload);
Otherwise it throws error
----------------------------------------------------------------------------------------------------------------
ASP.Net Validation Controls
1. Validation for Non-Numeric and Decimal Values
It will restrict alphabets characters. It will allow only Numbers or
decimal values.
style="text-align:right" Width="53px" BackColor="#82CAFA"
BorderStyle="Dotted" BorderWidth="1px">
runat="server" ErrorMessage="Only Number allowed"
ControlToValidate="Target" ValidationExpression="^\d*[0-9](|.\d*[0-9]|,
\d*[0-9])?$" ValidationGroup="METVAL">
----------------------------------------------------------------------------------------------------------------
It will restrict alphabets characters. It will allow only Numbers or
decimal values.
BorderStyle="Dotted" BorderWidth="1px">
ControlToValidate="Target" ValidationExpression="^\d*[0-9](|.\d*[0-9]|,
\d*[0-9])?$" ValidationGroup="METVAL">
----------------------------------------------------------------------------------------------------------------
Monday, March 11, 2013
ASP.Net and C Sharp String Manipulation
1.using foreach loop for split the comma in that string
foreach (string c in Controls.Text.Split(','))
{
if (c == Target.ID)
{
}
}
2.Get the specific values in that string using substring method
3.Replace the string
toAddress = toAddress.Replace(";", ",");
4.Get the string after comma
string[] words = subject.Split(',');
string title = words[0];
string Roomtoretrieve = words[1];
string MeetingRoom = words[2];
Subscribe to:
Posts (Atom)