[ Solved ] Applying Fore color for textbox or Label in c# code behind

By NANDA KUMAR
Code:
TextBox1.ForeColor = System.Drawing.Color.Yellow;
(or)
TextBox1.ForeColor = System.Drawing.ColorTranslator.FromHtml(dr["textcolor"].ToString()); // From Database value
 

[ Solved ] Get Width and Height of an image using C#

Category: By NANDA KUMAR
Code:
using System.Drawing; //include this namespace

Bitmap uploadedimage = new Bitmap(FileUpload1.PostedFile.InputStream);
string hei = String.Format(uploadedimage.Height.ToString());
string wid = String.Format(uploadedimage.Width.ToString());

Description:
Fileupload1 is the name of the Control you have used for uploading files.
 

[ Solved ] Refresh Page once while Loading using Javascript Tag

Category: By NANDA KUMAR
Code:
<script language="javascript">opener.location.reload(true) </script>

Description:
Place the above code in between the javascript tags in a page,to make the page to be refreshed once.
 

[ Solved ] Page Refresh for every one minute using meta Tag

Category: By NANDA KUMAR
Code :
<meta content="10" http-equiv="refresh"/>

Description:
Place the above code in Header part of the page.ie between the
meta tags.it will cause the page to be refreshed automatically for every 1 minute.
 

[ Solved ] To Store date without time using SQL server commands

Category: By NANDA KUMAR
convert(datetime, convert(char, getdate(), 106));
 

[ Solved ] Apply Bold Style to a Label Text from Check Box C# code behind

Category: By NANDA KUMAR
private void chkboxBold_CheckedChanged(object sender, EventArgs e)

{

if (chkboxBold.Checked)
{

LblText.Font = new Font("verdana", 12, FontStyle.Bold);

}

}
 

[ Solved ] Convert a String to Proper case using C# using System.Globalization Header

Category: By NANDA KUMAR
using System.Globalization; 

//Code

string sample = "wELCome To my World";

TextInfo t1 = new CultureInfo("en-US", false).TextInfo;

Response.Write(t1.ToTitleCase(sample ));


//Result :  Welcome To My World;
 

Welcome To My Post!!

Category: By NANDA KUMAR
Hi friends,
Thank you all for visiting my Blog. Here, you'll learn about Source codes and reviews from Dotnet, as well as other great blogs with similar information.

if you have any suggestions on how I can improve it, please don't hesitate to contact me.

Have a cheerful day!!!