vb.net

How to compare strings in ASP.NET

Comparing 2 strings is often used action in any programming language. You could want to compare two strings when you check if the username and password entered by user are correct. Also it could be very useful if you search some text.This C# ASP.NET tutorial with show you several methods to compare the values of strings.

Compare strings in …

Learn more

How to connect to MySQL database using ASP.NET hosting

Many developers use ASP.NET with MySQL with their applications. If you use ASP.NET hosting services and some of the .NET stack as VB.NET or C# then you could connect to the MySQL database using ODBC .net data provider.

Connect to MysQL database using C# using ASP.NET hosting

OdbcConnection cn = new OdbcConnection(“Driver={MySQL ODBC ODBC 5.2a Driver};Server=localhost or remote;Database=test;User=user;Password=pass;Option=3;”);

OdbcCommand cmd …

Learn more

How to change the text of the Label control from the code-behind in VB.NET

TestPage (.aspx)

<%@ Page Language=”vb” AutoEventWireup=”false” CodeBehind=”TestPage.aspx.vb” Inherits=”TestChange.TestPage” %>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”https://www.w3.org/1999/xhtml”>

<head runat=”server”>

<title>Change the text of the Label control from the code-behind</title>

</head>

<body>

<form id=”form1″ runat=”server”>

<div>

<asp:Label ID=”LabelTest” runat=”server” Text=”My test label”></asp:Label>

</div>

</form>

</body>

</html>

Test page code-behind (.vb)

‘TestPage.apsx.vb

Public Class TestPage

Inherits System.Web.UI.Page

Protected Sub …

Learn more

How to create a simple content page in ASP.NET

You can use your master page created as described in the article: How to create a simple master page in ASP.NET in another page by adding the MasterPageFile attribute to the Page directive. This attribute indicates the filename of the master page you want to use:

In VB.NET

<%@ Page Language=”VB” MasterPageFile=”./SiteTemplate.master” … %>

In C#

<%@ Page Language=”C#” MasterPageFile=”./SiteTemplate.master” …

Learn more

How to create a simple master page in ASP.NET

You can create a master page by following the next steps in Visual Studio:

1. Select Website ➤ Add New Item from the menu.

2. Select Master Page

3. Give it a filename for example SiteTemplate.master

4. Click Add.

A master page is a similar to an ordinary ASP.NET web form and can …

Learn more

How to use the Menu navigation control in ASP.NET in VB.NET

The Menu control like the TreeView control supports hierarchical data. You can bind the Menu to a data source, or you can fill it by hand (declaratively or programmatically) using MenuItem objects. The MenuItem objects don’t support check boxes and you can’t set programmatically their expanded/collapsed state. The next table lists MenuItem properties you can use:

 

Learn more

How to populate the TreeNode objects in ASP.NET in VB.NET

If your project has a large amount of data to display in a TreeView, you probably don’t want to fill it in all at once, because that increase the time taken to process the initial request for the page, and also increase the size of the page and the view state.  The TreeView includes a populate-on-demand …

Learn more