Code Snippets - ASP.NET, C#, JAVA, Android. Tutorials, Code Snippets, Bug Fixing etc
<style>
.button {
width: 150px;
padding: 10px;
background-color: #2d57f8;
box-shadow: -8px 8px 10px 3px rgba(0,0,0,0.2);
font-weight: bold;
text-decoration: none;
}
#cover {
position: fixed;
top: 0;
left: 0;
background: rgba(0,0,0,0.6);
z-index: 5;
width: 100%;
height: 100%;
display: none;
}
#popupScreen {
height: 380px;
width: 340px;
margin: 0 auto;
position: relative;
z-index: 10;
display: none;
background: url(login.png) no-repeat;
border: 5px solid #cccccc;
border-radius: 10px;
background-color:rgb(245,245,245);
}
#popupScreen:target, #popupScreen:target + #cover {
display: block;
opacity: 2;
}
.cancel {
display: block;
position: absolute;
top: 3px;
right: 2px;
background: rgb(245,245,245);
color: black;
height: 30px;
width: 35px;
font-size: 30px;
text-decoration: none;
text-align: center;
font-weight: bold;
}
</style>
<div align="center"><a href="#popupScreen" class="button">Click here for Dialog</a> </div>
<div id="popupScreen">
<a href="#" class="cancel">×</a>
<h2>Hi there</h2>
</div>
<div id="cover"></div>
<staticContent> <mimeMap fileExtension=".mp4" mimeType="video/mp4" /> <mimeMap fileExtension=".m4v" mimeType="video/m4v" /> <mimeMap fileExtension=".ogg" mimeType="video/ogg" /> <mimeMap fileExtension=".ogv" mimeType="video/ogg" /> <mimeMap fileExtension=".webm" mimeType="video/webm" /> <mimeMap fileExtension=".oga" mimeType="audio/ogg" /> <mimeMap fileExtension=".spx" mimeType="audio/ogg" /> <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> <mimeMap fileExtension=".svgz" mimeType="image/svg+xml" /> <remove fileExtension=".eot" /> <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" /> <mimeMap fileExtension=".otf" mimeType="font/otf" /> <mimeMap fileExtension=".woff" mimeType="font/x-woff" /> </staticContent>
The above snippet incl![]() |
| Hostgator Offers |
public static bool HasNull(this DataTable table)
{
foreach (DataColumn column in table.Columns)
{
if (table.Rows.OfType<DataRow>().Any(r => r.IsNull(column)))
return true;
}
return false;
}
and use
table.HasNull();
DBNull.Value value to filter and manage null values in whatever way you see fit.
foreach(DataRow row in table.Rows)
{
object value = row["ColumnName"];
if (value == DBNull.Value)
// do something
else
// do something else
}
Check More About DBNull Class
![]() |
| Get 25% Off on HostGator Hosting Coupon Code |
string file = Server.MapPath ("abc.html");
StreamReader sr;
FileInfo fi = new FileInfo(file);
if(File.Exists(file))
{
sr = File.OpenText(file);
input += sr.ReadToEnd();
sr.Close();
}
string[] lines = File.ReadAllLines("path/to/my/file.html");
foreach(string line in lines)
{
Response.Write(line);
}
DateTime dt = DateTime.ParseExact(dr["dateCreated"].ToString().Trim(),
"M/d/yyyy h:mm:ss tt", CultureInfo.InvariantCulture);
//dr["dateCreated"] returnsdate from database
DateTime date4;
string dateString = @"20/05/2012";
bool result = DateTime.TryParse(dateString,out date4);
the parsing fails, but it will not throw error, rather it returns
falseindicating that theparsing failed.
string dateString = @"20/05/2012";
DateTime date2 = Convert.ToDateTime(dateString,
System.Globalization.CultureInfo.GetCultureInfo("hi-IN").DateTimeFormat);
Copyright @ 2013 Code Snippets.