If you want to select a record in a Gridview in VB.Net and then edit that record in a separate page, then you can use the following code to give you an idea.
I assume that you alredy know how to add a gridview and populate it using vb.net
You would need to add a hyperlink field in the gridview columns as shown belo
The headertext will show what will appear in the header row
datatextfield will be name of your datafield which is the primary key for the data
datanavigateurlformatstring – this field will construct the name of your page which the system will navigate to if someone clicks on the edit button
datanavigateurlfields is again the primary key eg. My primary key was “NewsId”
DataTextFormatString tells what will be displayed on the data gridl eg. I want to show a hyperlink called “Edit”
so whenever someone clicks on the edit button the system will take you to the “EditNews.aspx?q=1 where 1 will be the NewsID
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 should thank the user and display the new rating value. I wanted this to shown on the same page without reloading the page, So I considered using AJAX.BeginForm which will simply work fine.
In order to have this AJAX functionality you will have to download the AJAX from NUGET.
Install the following two highlighted packages from NUGET. Click here to check how to load Packages from NUGET in Visual Studio
Once you have installed the above two packages through NUGET then do the following.
Go to the _Layout file in your _shared folder in the Views. ( Note that I am using VB.NET but the example will work for C# also.
Open the _Layout.vbhtml file and browse to the bottom.