hankknight
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:
Code:
<%@ Page Title="xyz" Language="VB" AutoEventWireup="false" CodeFile="xyz.aspx.vb" Inherits="runme" %>
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.