How to replace rows in List view?

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
rsbr
User
Posts: 8

How to replace rows in List view?

Post by rsbr »

Hi,

I am no an experienced coder, but I managed to make a few good simple apps with ASP.NET MAKER. however, in my most recent project, I need to display results of a table valued function or a stored procedure that takes a parameter to construct the list. I tried to have a view with a default parameter value to return 0 records so that ASP.NET can build the page. But how can I run my procedure and fill in the list with the resulting rows?

Any help would be much appreciated.


MichaelG
User
Posts: 1171

Post by MichaelG »

To use stored procedure, please read:
viewtopic.php?f=7&t=50935


rsbr
User
Posts: 8

Post by rsbr »

Hi MichaelG,
This somehow explains how to make it in a Custom Page. What I did is as follows:

  • Created a view that results in 0 records
  • Synched ASP.NET MAKER to generate all the code for it (My concern is the LIST PAGE)
  • I don't need ADD, EDIT, VIEW, just need LIST

What I am trying to achieve is to run SQL in any form:
1- sql = "SELECT * FROM dbo.myfunction(@Parameter)"
2- Stored Procedure that has the sql from (1)

and before the page is loaded with 0 records from the original Recordset I want to load the records from the SQL I ran.

I think I need to do something like

// Get the value of @parameter from Session Variable or anyother means

if CurrentPageID = "list" && CurrentPageName = "myPageName"
{
	CurrentPage.sqlSelect =  "SELECT * FROM dbo.myfunction(@Parameter)" 
}

and let ASP.NET MAKER do the rest as I want to add some ListOptions etc....

Can you provide some guidance how to do this?
Your advice is highly appreciated.
R.S


MichaelG
User
Posts: 1171

Post by MichaelG »

You can probably make use of the server events in the list page to do this.


Post Reply