I have a vb.net code with one class "letprop" in the APP_code folder. I am wondering if I could pass a value from the aspx page to the letprop class.
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
contract id =
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
Code:
this code is in app_code folder---------
Imports Microsoft.VisualBasic
Imports Oracle.DataAccess.Client
Imports Oracle.DataAccess.Types
Imports System.Data
Imports System.Configuration.ConfigurationManager
Public Class prop
Private Shared Function GetConnectionString() As String
Return ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
End Function
----I would like to pass the parameter value to this function
Public Shared Function GetLetProp() As DataSet
Dim sel As String = "select lcontid, avendor,letting, datepub from letprop where contractid = :txtContractId "
Dim daLetprop As OracleDataAdapter = New OracleDataAdapter(sel, GetConnectionString)
Dim dsLetProp As DataSet = New DataSet
daLetprop.Fill(dsLetProp, "tLetprop")
Return dsLetProp
End Function
End Class
Code: