Skip to main content

Posts

Showing posts from March, 2014

javascript to clear controls in asp.net client side

Code :     <script type="text/javascript">          function clearall() {             document.getElementById("ctl00_cphHeading_rblpaymentmode_1").checked = false;             document.getElementById("ctl00_cphHeading_rblpaymentmode_0").checked = false;             document.getElementById("ctl00_cphHeading_txtscratchkey").value = "";             document.getElementById("ctl00_cphHeading_txtserialno").value = "";             document.getElementById("ctl00_cphHeading_txtcontactnumber").value = "";             document.getElementById("ctl00_cphHeading_chkundertaking").checked = false;         }   </script> <input id="btnreset" type="button" value="Reset" onclick="clearall();" class="aspButton" />

checkbox validation in asp.net on form submission client side

Code : <script type="text/javascript">         function ValidateCheckBox(sender, args) {             if (document.getElementById("<%=chkundertaking.ClientID %>").checked == true) {                 args.IsValid = true;             } else {                 args.IsValid = false;             }         }     </script>

Tips to keep eyes fit and healthy

Maintaining Good Eye Health Don't take your eye health for granted. Protect your eyesight with these six tips: 1. Eat for Good Vision Protecting your eyes starts with the food on your plate. Studies have shown that nutrients such as omega-3 fatty acids, lutein, zinc, and vitamins C and E may help ward off age-related vision problems such as macular degeneration and cataracts. Regularly eating these foods can help lead to good eye health: Green, leafy vegetables such as spinach, kale, and collards Salmon, tuna, and other oily fish Eggs, nuts, beans, and other non-meat protein sources Oranges and other citrus fruits or juices Eating a well-balanced diet also helps you maintain a healthy weight, which makes you less likely to get obesity-related diseases such as type 2 diabetes. Diabetes is the leading cause of blindness in adults. 2. Quit Smoking for Better Eyesight Smoking makes you more likely to get cataracts, optic nerve damage, and macular degener

How To Keep Your Skin Healthy

Tip #1 for healthy skin: Sun protection Ensure you protect your skin from the sun to maintain healthy skin According to the Mayo Clinic in Rochester, Minnesota, USA, a non-profit organization with an international reputation, most of the changes seen in ageing skin are actually "caused by a lifetime of sun exposure". To protect yourself from the sun, they advise the following three methods (with maximum protection coming from using all three). Avoid the sun during high intensity hours : the sun's rays do the most damage between 10 am and 4 pm, so limit the time you spend outside during this period. Wear protective clothing : wear long sleeved shirts, long trousers or pants and a hat with a wide brim. Remember that tight woven fabric (eg denim) offers better protection than loosely woven fabrics like knits. Use sunscreen : go for a broad spectrum sunscreen with an SPF (sun protection factor) higher than 15 and apply generously about 20 minutes befor

Benefits of pushups

It’s the exercises you hate the most that your body needs the most.    Push-Ups Build Strength – Everywhere Push-ups are one of the oldest and most basic of exercises for a simple reason. They work. The exercise positions all the muscles in our upper body and builds optimal strength in the forearms, shoulders, chest. And for the ladies, they will “get rid of the jig” by targeting the upper arms. And when done properly, also put emphasis on building a strong core by stabilizing the abdominals and back. There is even some benefits to your quads and hammies.    Push-Ups Boosts Metabolism   Because you’re making everything work, you are pushing your body towards total physical exertion. And while that hurts a little, might make you want to throw up a little, it also forces your heart to work harder. Your muscles demand more oxygen to make energy and the only way to get it is from the heart pumping blood around faster. That will boost your metabolic rate so you burn

Benefits Of Green Tea

1. Green tea and cancer: Green tea helps reduce the risk of cancer. The antioxidant in green tea is 100 times more effective than vitamin C and 24 times better than vitamin E. This helps your body at protecting cells from damage believed to be linked to cancer. 2. Green tea and heart disease: Green tea helps prevent heart disease and stroke by lowering the level of cholesterol. Even after the heart attack it prevents cell deaths and speeds up the recovery of heart cells. 3. Green tea and Anti-aging: Green tea contains an antioxidant known as polyphenols which fight against free radicals. What this means it helps you fight against aging and promotes longevity. 4. Green tea and weight loss: Green tea helps with your body weight loss. Green tea burns fat and boosts your metabolism rate naturally. It can help you burn up to 70 calories in just one day. That translates to 7 pounds in one year. 5. Green tea and skin: The antioxidant in green tea protects the skin from

How To Read Excel File Content in ASP.NET

Using excel File in asp.net is very easy and very useful in many places For example in many conditions you want to upload data online through excel file into database Like Offline Attendence,Offline entries.Below code not only help you in just reading the excel file but also to apply many validation like excel sheets count,single sheet column count,single column rows count,file upload extension name etc etc.But this code works only for .xls file extension but not for .xlsx.Before Using below code import namespaces written below and use fileupload control for file upload and button to upload excel and parse it. using ExcelLibrary.SpreadSheet; using ExcelLibrary; // on button click  if (flupload.HasFile == true)             {                 string path = Path.GetExtension(flupload.PostedFile.FileName);                 if (path == ".xls")                 {                     string FileName = Path.GetFileName(flupload.PostedFile.FileName);                     flupload.

View State in ASP.NET

The most significant difference between programming for the web and programming for the desktop is state management - how you are able to store information for the particular amount of time or one can say lifetime of your application.This information can be of any type or of any level of complexity. In a desktop application there is  nothing to worry about storage because we have sufficient storage and can be used by only a user at a time but what about web application, there we are not sure about the users who make use of application (located at web server) at a time by stateless HTTP connection.So we have to do something in such a manner that our web application will be able to store as our desktop application works and that storage will be different for different users or one can say in the way the user wants. PROBLEM OF STATE In a windows application, users interact with the continuous running application.That is pretty simple and everything is done at single user level.But