Click here to Skip to main content
15,888,056 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to display certain records if user's search comes up empty? Pin
samflex14-Aug-14 7:01
samflex14-Aug-14 7:01 
GeneralRe: How to display certain records if user's search comes up empty? Pin
Richard Deeming14-Aug-14 7:28
mveRichard Deeming14-Aug-14 7:28 
GeneralRe: How to display certain records if user's search comes up empty? Pin
samflex14-Aug-14 17:07
samflex14-Aug-14 17:07 
GeneralRe: How to display certain records if user's search comes up empty? Pin
Richard Deeming18-Aug-14 2:02
mveRichard Deeming18-Aug-14 2:02 
GeneralRe: How to display certain records if user's search comes up empty? Pin
samflex18-Aug-14 2:54
samflex18-Aug-14 2:54 
GeneralRe: How to display certain records if user's search comes up empty? Pin
Richard Deeming18-Aug-14 7:15
mveRichard Deeming18-Aug-14 7:15 
GeneralRe: How to display certain records if user's search comes up empty? Pin
samflex18-Aug-14 8:04
samflex18-Aug-14 8:04 
GeneralRe: How to display certain records if user's search comes up empty? Pin
Richard Deeming18-Aug-14 8:38
mveRichard Deeming18-Aug-14 8:38 
There are two things missing from the top of your updated showGrid method which were in the original code:
VB.NET
SearchString = txtSpecificDate.Text
ViewSelect = Request("ViewBy")
If ViewSelect = "" Or ViewSelect = "Range" Then
    ViewSelect = "Range"
Else
    ViewSelect = "Specific"
End If


Also, since your dates are datetime, and your original code was only comparing the date part, you'll need to update the date filters:
VB.NET
If ViewSelect = "Range" Then
    sb.Append(If(startedWhere, andors, " WHERE "))
    sb.Append("(d.trainingDates >= @FromDate And d.trainingDates < DateAdd(day, 1, @EndDate))")
    cmd.Parameters.AddWithValue("@FromDate", Date.Parse(txtFromDate.Text))
    cmd.Parameters.AddWithValue("@EndDate", Date.Parse(txtToDate.Text))
    startedWhere = True

ElseIf ViewSelect = "Specific" Then
    sb.Append(If(startedWhere, andors, " WHERE "))
    sb.Append("(d.trainingDates >= @SpecificDate And d.trainingDates < DateAdd(day, 1, @SpecificDate))")
    cmd.Parameters.AddWithValue("@SpecificDate", Date.Parse(txtSpecificDate.Text))
    startedWhere = True
End If


I can't see any obvious reason for the paging issues. I'd probably be inclined to use a DataPager control[^] rather than custom LinkButton controls, but if your code worked with the old version of the showGrid method, it should work just as well with the new version.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: How to display certain records if user's search comes up empty? Pin
samflex18-Aug-14 10:55
samflex18-Aug-14 10:55 
QuestionAJAX control Pin
murali_utr13-Aug-14 23:09
murali_utr13-Aug-14 23:09 
GeneralRe: AJAX control Pin
Kornfeld Eliyahu Peter13-Aug-14 23:18
professionalKornfeld Eliyahu Peter13-Aug-14 23:18 
GeneralRe: AJAX control Pin
murali_utr14-Aug-14 18:00
murali_utr14-Aug-14 18:00 
QuestionGet original string from Guid Pin
Member 947380913-Aug-14 19:06
Member 947380913-Aug-14 19:06 
AnswerRe: Get original string from Guid Pin
Bernhard Hiller13-Aug-14 21:57
Bernhard Hiller13-Aug-14 21:57 
AnswerRe: Get original string from Guid Pin
Kornfeld Eliyahu Peter13-Aug-14 22:27
professionalKornfeld Eliyahu Peter13-Aug-14 22:27 
AnswerRe: Get original string from Guid Pin
Richard MacCutchan13-Aug-14 22:28
mveRichard MacCutchan13-Aug-14 22:28 
QuestionRe: Get original string from Guid Pin
Member 947380915-Aug-14 18:49
Member 947380915-Aug-14 18:49 
QuestionDynamic Linq Query in vb.net Pin
murali_utr12-Aug-14 18:51
murali_utr12-Aug-14 18:51 
AnswerRe: Dynamic Linq Query in vb.net Pin
Bernhard Hiller12-Aug-14 21:11
Bernhard Hiller12-Aug-14 21:11 
QuestionFetch data from database based checkboxlist selection getting error Pin
Venugopal626412-Aug-14 17:34
Venugopal626412-Aug-14 17:34 
AnswerRe: Fetch data from database based checkboxlist selection getting error Pin
Bernhard Hiller12-Aug-14 21:14
Bernhard Hiller12-Aug-14 21:14 
QuestionSession variable expires even though session time was set to 9 hours. Pin
Kandepu Rajesh12-Aug-14 9:12
Kandepu Rajesh12-Aug-14 9:12 
AnswerRe: Session variable expires even though session time was set to 9 hours. Pin
Kornfeld Eliyahu Peter12-Aug-14 20:20
professionalKornfeld Eliyahu Peter12-Aug-14 20:20 
AnswerRe: Session variable expires even though session time was set to 9 hours. Pin
Swinkaran12-Aug-14 21:28
professionalSwinkaran12-Aug-14 21:28 
QuestionSession_Start not fire in IIS7 - Windows Server 2008 (64bit) Pin
android_lee11-Aug-14 23:01
professionalandroid_lee11-Aug-14 23:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.