In VB.NET Use tablControl1.SelectedTab = MyTabName In C# use tabControl1.SelectedTab = MyTabName; MytabName will automatically be displayed.
Learn how to use Applications Settings in Visual Studio 2013 Winform project in VB.NET Here is a simple way of storing applications settings. Step 1 In your Visual Studio Project open the settings. Step 2 When you click on the Settings as shown in Step 1, you would get the following screen. You […]
How to use Paging using the PagedList Once you have installed the PagedList package from NUGET Controller Add the following two imports at the top of the header Imports PagedList Imports PagedList.Mvc Your Linq or SQL query should be sorted eg. Dim v = (From vid In db.qry_Videos Where vid.CatID = […]
Step 1 In Visual Studio Go to Tools > Library Package Manager > Manage Nuget Packages for Solution. Step 2 You would get the following screen, you can check the packages which you have already available in your solution, you can search for new packages and install them to your solution. Remember: These […]
I realised that in my MVC5 project in Visual Studio I could not get the Ajax.BeginForm to work properly. It will always do a full postback. I was trying to complete a Video Rating Page, where there are buttons to rate a video and once the user presses one of the rating button, it […]
Add the name space in your controller at the top using Microsoft.AspNet.Identity; Wherever you need to get the user id use the following code in your controller string userId = User.Identity.GetUserId();
Here is a simple code snippet to loop through the records in VB.NET using LINQ The following code example takes the records from an Entity Framework Model named as Video and then allows to loop through each record. Dim List As List(Of Video) List = (From video In db.Videos Order By video.ID […]
Scenario: If you have two controllers with the same name in different areas, then you would end up with errors as shown below, while there are numerous examples available on the web but it took me a while to figure out the correct solution for VB. Hope it help you and saves you time. Problem […]
VB.NET – You must call the “WebSecurity.InitializeDatabaseConnection” method before you call any other method of the “WebSecurity” class.
Problem description: If you are getting the error while running your MVC4 application in VB.NET You must call the “WebSecurity.InitializeDatabaseConnection” method before you call any other method of the “WebSecurity” class. Solution Add the following line in the GLOBAL.ASX Ensure that you are using the correct connection string and other information as per your […]