Let’s say you have a checkbox with the name ‘MyCheckBox”. Using JQuery, here’s a function you can use to be able to tell whether or not it’s checked:
$(document).ready(function () {
$("#MyCheckBox").click(function () {
var chk=this.checked;
if (chk==true)
{alert("Mycheckbox is checked");}
else
{alert("Mycheckbox is NOT checked");}
});
});
When using the built in Validation controls with Web Forms controls, sometimes there is a confusion because of the ErrorMessage and Text properties.
Read the rest of this entry »
If you are using SharePoint 2010, and you are trying to open an Excel file from a list, AND you come across the error above (also suggesting that you “Wait a few minutes and try performing this operation again”), the solution may be easier than you think.
Read the rest of this entry »
Sometimes, you can make changes using Visual Studio (at this point, I’m still using VS 2010), but when you run the app for debugging, the changes don’t appear. This may then be a cache issue, but it’s very easy to fix.
Read the rest of this entry »
When using SQL Server Management Studio, sometimes (especially during testing phases) it becomes necessary to enter data manually. It’s easy when you actually want to enter text via specific datatypes, but what do you do when you want to force a field to null?
Read the rest of this entry »
First, let’s start off by explaining what an automatic or auto-implemented property is. Earlier in VB.Net, to create a property, you would need a structure like this:
Private _Name As String = ""
Public Property Name As String
Get
return _Name
End Get
Set(value As String)
_Name = value
End Set
End Property
In your MVC models, if you have a date property which is populated from the database with Date and Time, it’s very easy to format the output so that it’s just the date (toShortString()). However, there are two ways to do this, using Display/Edit Annotations.
Read the rest of this entry »
Let’s say you have an Action method named ‘Edit’.
public ActionResult Edit(int CustID)
However you really don’t like the word ‘Edit’ for some reason. there is a very easy way to create an Alias for your Action method to be used in place of the one already there.
Read the rest of this entry »
During my MVC learning process, my first app started with a basic display form – the data received from the database was in decimal format. So my first stumbling block was figuring out how to make it display as a decimal on screen. The second stumbling block was making it display as a decimal in Edit mode.
Read the rest of this entry »
Let’s say you have a generic list:
(VB.Net)
Dim ProdList As New List(Of String)
With ProdList
.Add("Alice Mutton")
.Add("Chai")
.Add("Chang")
.Add("Gravad lax")
End With
(C#)
List ProdList = new List(Of, String);
ProdList.Add("Alice Mutton");
ProdList.Add("Chai");
ProdList.Add("Chang");
ProdList.Add("Gravad lax");
Then, let’s say you want to loop through those items, one at a time and manipulate each one in some manner or form. It’s pretty easy, as you will see.
Read the rest of this entry »
All Things DotNet Discussed – Winforms/ASP.Net/SharePoint/WPF