Avatar of hankknight
hankknight
Flag for Canada asked on

ASP.NET/VB: Using classes without codebehind

How can I combine these two files into one aspx file with no codebehind file?

Code:
<%@ Page Title="xyz" Language="VB" AutoEventWireup="false" CodeFile="xyz.aspx.vb" Inherits="runme" %>

Open in new window

Code Behind:
Imports System.Web.Script.Serialization
Public Class runme
    Inherits System.Web.UI.Page
    Dim obj As ResultRows
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim data As String = "{""total_rows"":1,""offset"":0,""rows"":[ {""xyz"":""Hello World"",""key"":""abc""}]}"
        Dim jsd As New JavaScriptSerializer
        obj = jsd.Deserialize(Of ResultRows)(data)
        Response.Write(obj.rows(0).xyz)
    End Sub
End Class

Public Class ResultRows
    Public rows() As ResultRow
End Class

Public Class ResultRow
    Public xyz As String
End Class

Open in new window

Visual Basic.NETASP.NET

Avatar of undefined
Last Comment
Robert Schutt

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Robert Schutt

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Your help has saved me hundreds of hours of internet surfing.
fblack61