ASP.Net Archives - Page 4 of 10 - All Things DotNetAll Things DotNet
  • Subscribe to this RSS feed
  • Receive updates as soon as they are posted.

ASP.Net Category

February 4 , 2013 | | In: C#, MVC3

Show Webgrid in View Only if Populated

I came across a situation in which I needed the MVC Webgrid on my page, but only after I retrieved the criteria to do a search. Having a LIST in my model for the data to populate the grid, if I put the webgrid in the View, when the View loaded, it threw an error […]

January 29 , 2013 | | In: MVC3

Debugging MVC 3 – ‘The resource cannot be found’

OK – let’s say you have your new MVC 3 project loaded in Visual Studio. The focus is on your cshtml or vbhtml page, and you presss F5 or click the Debug arrow. You get really ticked off, because the web page that comes up, gripes at you and tells you: “The resource cannot be […]

January 7 , 2013 | | In: ASP.Net, MVC3

MVC and HTML Version in Visual Studio 2010

Let’s say you’ve created a new MVC 3 application, and here and there, within your HTML, you are given messages that <whatever tag or attribute> isn’t supported within the XHTML 1.0 Transitional validation target.

This would probably be most effective inside an MVC application because in Web Forms, you can do this easily by changing the attributes on the controls themselves, though, even still, this would be more efficient. Here’s the scenario. You want to create a function for each and every textbox on your page, so that, when […]

January 7 , 2013 | | In: ASP.Net, ASP.Net Tips, JQuery, MVC3

Change CSS Attributes with JQuery

You can easily use JQuery to change the CSS of HTML tags. Of course, you can either change them inside a function, or outside a function, inside the Script Tag. Here’s a way inside an ‘onblur’ function: $(“#MyTextBox).blur(function () { $(this).css(“background-color”, “red”); } All you’d need to do inside a Script Tag (which would make […]

December 12 , 2012 | | In: ASP.Net, ASP.Net Tips

WebForms Validation Tip

When using the built in Validation controls with Web Forms controls, sometimes there is a confusion because of the ErrorMessage and Text properties.

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

October 22 , 2012 | | In: MVC3

2 Different Ways to Format an MVC Date

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.

October 19 , 2012 | | In: MVC3

Create an Alias for your Action Methods

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.

October 17 , 2012 | | In: MVC3

MVC3 – Decimal Format in Display AND Edit

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 […]



All Things DotNet Discussed – Winforms/ASP.Net/SharePoint/WPF


If you find this site helpful,
please donate to help keep it online and free





Code 'n' Sprox   DreamTemplate - Web Templates

Follow us on Twitter

Follow AllThingsDotNet on Twitter


Test - The Name: 6936