I have been an ASP developer for years and am trying to get my arms around ASP.NET. I am trying to call a function from my ASPX file that exists in my VB file. The function makes a call to SQL Server to get a list of records to display. I am trying to do all of the looping in the VB file and just have that information returned to the ASPX file with a Response.Write.
I have seen somewhere where the person created the DataReader in the ASPX file and then referenced it from the VB file. This allowed him to loop through the resultset in the ASPX file. I would prefer to do my looping in the ASPX file and return a StringBuilder or a Response.Write or even an HTMLTextWriter.
I have also seen where I can create a namespace and do it that way. Again, this just feels too clunky. Maybe this is the best way to do it, but I really don't know.
What do you folks do? I would like to see a couple of different suggestions so that I can debate the pros and cons.
Thanks in advance!!
I have seen somewhere where the person created the DataReader in the ASPX file and then referenced it from the VB file. This allowed him to loop through the resultset in the ASPX file. I would prefer to do my looping in the ASPX file and return a StringBuilder or a Response.Write or even an HTMLTextWriter.
I have also seen where I can create a namespace and do it that way. Again, this just feels too clunky. Maybe this is the best way to do it, but I really don't know.
What do you folks do? I would like to see a couple of different suggestions so that I can debate the pros and cons.
Thanks in advance!!