I am writing an app that allows me to add search criteria, then click a search button to build and execute a query. I need to be able to provide a dialog box if the result set is > 1000 records so that the user can cancel if they want. I am aware of all the nasty problems involved with using popup message boxes in ASP.NET. I was trying to use the approach that would be like:
I do this assignment in the onload event, works great.
However, my search function is more like:
Obviously, this is psuedocode . As you can see, I raise an event called maxRecordsExceeded. I try to, anyways. I have never done this before, so I don't really know if I'm doing it right.
At the top of my page, I declared an event
I changed the onLoad call to
I was hoping that what would happen would be that the raised event would be handled in the middle of the sub and pop up my message, but I'm thinking that it's not going to work Can anyone help me visualize how I could do this?
Code:
cmdCtrlSearch.Attributes.Add("onclick", "javascript:return confirm('Your query has resulted in lots of records. /n Retrieving this many records may take a long period of time. /n It is recommended that you canvel this search and refine your search criteria. /n Do you want to continue?');")
However, my search function is more like:
Code:
sub search
.
.
BuildSearch()
AnalyzeQuery()
ExecuteQuery()
If ResultSet.Rows.Count > gMaxRows Then
RaiseEvent maxRecordsExceeded()
End If
DisplayRecords()
end sub
Obviously, this is psuedocode . As you can see, I raise an event called maxRecordsExceeded. I try to, anyways. I have never done this before, so I don't really know if I'm doing it right.
At the top of my page, I declared an event
Code:
Public Event maxRecordsExceded()
I changed the onLoad call to
Code:
cmdCtrlSearch.Attributes.Add("maxRecordsExceeded", "javascript:return confirm('Your query has resulted in lots of records. /n Retrieving this many records may take a long period of time. /n It is recommended that you cancel this search and refine your search criteria. /n Do you want to continue?');")
I was hoping that what would happen would be that the raised event would be handled in the middle of the sub and pop up my message, but I'm thinking that it's not going to work Can anyone help me visualize how I could do this?