All Things DotNet - Page 3 of 32 - All Things DotNet Discussed - Winforms/ASP.Net/SharePoint/WPFAll Things DotNet
  • Subscribe to this RSS feed
  • Receive updates as soon as they are posted.
March 19 , 2015 | | In: ASP.Net, MVC

Using HTML Tags in ViewBag

If you have html line breaks, links or other HTML tags that you’d like to use in a ViewBag, it’s not as hard as it seems. At first I tried Html.Encode/Decode, but that didn’t work. It seemed like the things I tried just kept adding to a list of items that proved you couldn’t do it.
Read the rest of this entry »

January 8 , 2015 | | In: ASP.Net, VB.Net, Visual Studio

Me Keyword Doesn’t Work

Let’s say you still use VB.Net. Also, for some reason you notice that your ‘Me’ keyword no longer works (not recognized by intellisense) and that your application startup subroutines errors out and says “Event ‘Startup’ cannot be found”.

It sounds really catastrophic, but for me, it wasn’t that big a deal. In the Application button of the project settings, make sure that the checkbox for ‘Enable Application Framework’ is checked. If you find that it’s unchecked, that’s the problem.

January 6 , 2015 | | In: ASP.Net Tips, MVC

Prefill Textboxes with Decimal Format

Let’s say you’re getting data from a database, and some of the data is null (maybe it’s an integer). A very common approach is to iterate through a table:

 dtEmployees = emp.Get(sqlGetEmployees);
foreach (DataRow drEmp in dtEmployees.Rows)
 ptt.Fieldname = drEmp["Fieldname"] != DBNull.Value ? 
          int.Parse(drEmp["Fieldname"].ToString()) :0;

That will populate the page with a ‘0’ for that item. And, if that’s a decimal:

 ptt.Fieldname = drEmp["Fieldname"] != DBNull.Value ? 
          decimal.Parse(drEmp["Fieldname"].ToString()) :0;

However, did you know that, with a decimal, you can can also format it like ‘0.00’? All you need to do is this:

 ptt.Fieldname = drEmp["Fieldname"] != DBNull.Value ? 
          decimal.Parse(drEmp["Fieldname"].ToString()) :0.00m;

That’s all there is to it.

December 1 , 2014 | | In: SharePoint, SharePoint 2010 Tips

Free SharePoint Videos

It’s always great when you can learn new things and it doesn’t cost you a dime. Here is a link that has over 200 SharePoint videos for free!

Let’s say you just created a brand spanking new document library and you want to transfer a bunch of files all at once because it would really be a chore uploading them one at a time. Then, when you open the ‘Add Document’ dialog, you don’t see the familiar ‘Upload Multiple Files…’ link. Also, the ‘Upload Multiple Documents’ button in the ribbon will be disabled. Don’t panic it might be a very simple solution. First, ask others – see if you are the only one to which this happens.
Read the rest of this entry »

In this, I’m using VS.Net 2013. As you know, you can easily debug with VS, but did you know you can debug your Javascript/JQuery also?

In the image below, see that all you need to do is add the line:
debugger; (red arrow)

This will start debugging in your script. Just comment it out or remove it when you’re finished debugging. You only can enter your break points in the dynamic file that appears when the code stops at the debugger line. However, in VS.Net 2013, if all your JavaScript is in a separate page, this is not necessary. You can put break points directly in your Javascript code.
Debugging in Javascript

Also, notice (blue arrow) that, just as in C#/VB.Net, as you are debugging, you can hover over a variable to get its value. Then, notice the ‘pin’ icon on the far right. While that variable allocation is visible, click on the pin, and it will pin it to your code window (moveable). That way, it’s a ‘watch’ but you don’t have to move your eyes down to or open the watch window. It stays there between coding sessions so it will be there the next time you open that file.
Pinning debug values

October 23 , 2014 | | In: SharePoint, SharePoint Tips

HTML Tags Appear in Rich Text Fields

In SharePoint, if one of your fields is designated as a Rich Text or Enhanced Rich Text field, and your output is showing the HTML tags, then it very well could be an XSLT problem. When I found this, it was a DataView web part XSLT problem.
Read the rest of this entry »

October 13 , 2014 | | In: SQL Server, SQL Server Tips

SQL Server Stalls During Installation

This happened to me in both 2012 and 2014 SQL Server installations (on a clean Windows 2012 R2 installation) and frustrated me to no end. It was super hard just to get all the extra apps uninstalled. What happens is that installation fails when installing Setup Support files. It just hangs and won’t go any further. For me, I even had a drive disappear (D Drive).
Read the rest of this entry »

September 12 , 2014 | | In: ASP.Net, ASP.Net Tips, C#, DotNet General

Calculating Current Fiscal Year

If you are in a company in which the Fiscal Year does not start January 1st, it might become necessary in your code, to figure out what the actual Fiscal Year is at any point during the year. The following is a method (in C#) which returns a string based on the fact that the current Fiscal Year starts on September 1st, like many schools do.
Read the rest of this entry »

September 5 , 2014 | | In: SharePoint, SharePoint Tips

CQWP Bulleted Style

You may have noticed that, if you add a Content Query Web Part to your page and use the bulleted title style, that when, due to spacing, if your list item wraps to multiple lines, the actual bullet centers vertically in the middle. This may not be what you actually need.
Read the rest of this entry »


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