Datagrid Sort/Link Problem

R

rodg12

I designed a data grid for a results page for some product data. The
specific data put in the data grid is based on criteria entered into an
initial search page. I have enabled sorting in my data grid and have a
column of links which access a report on a specific product. However,
after I click to sort the data or click the link to get the report, I
can go no farther back using the back button than the results page. Has
anyone had this problem? I have dealt with setting SmartNav on and off
on the different pages and this does not fix the problem. Any
ideas on how to fix this????
 
R

rodg12

To add some info:
I use response.redirects to go to the next page and pass the values
from the search table using a query string. My data grid has 4
columns. Three bound columns and one template column that contains the
link to the report for that specific product. Here is my code for the
datagrid and the sorteventhandler:

<p><asp:datagrid id="dgResults" runat="server" HorizontalAlign="Center"
AlternatingItemStyle-BackColor="WhiteSmoke" AllowSorting="True"
AutoGenerateColumns="False"
OnSortCommand="SortEventHandler" width="624px">
<AlternatingItemStyle
BackColor="WhiteSmoke"></AlternatingItemStyle>
<Columns>
<asp:BoundColumn DataField="FSRNbr" SortExpression="FSRNbr"
HeaderText="FIX Number"></asp:BoundColumn>
<asp:BoundColumn DataField="OriginationDate"
SortExpression="OriginationDate" HeaderText="Origination Date"
DataFormatString="{0:MM-dd-yyyy}"></asp:BoundColumn>
<asp:BoundColumn DataField="ReportType"
SortExpression="ReportType" HeaderText="Report Type"></asp:BoundColumn>
<asp:TemplateColumn>
<ItemTemplate>
<a
href='report_redirect.aspx?FSRNbr=<%#DataBinder.Eval(Container.DataItem,"FSRNbr")%>&ReportType=<%#DataBinder.Eval(Container.DataItem,
"ReportType")%>'>
Get Report
</a>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid></p>

Dim conn As New
SqlConnection(ConfigurationSettings.AppSettings("FIXDataConn"))
Dim sortSQL As String
'Dim strSQL As String = BuildQuery()
sortSQL = Session("SQLString") & " Order By " &
e.SortExpression
Dim com As New SqlCommand(sortSQL, conn)
conn.Open()
dgResults.DataSource =
com.ExecuteReader(CommandBehavior.CloseConnection)
dgResults.DataBind()

Really need some help on this guys and gals.
 
E

Elton Wang

One solution is to open detail (report) page in a new window. So you don't
need backward. In order to open new window, you just add target = '_blank'
in <a> tag.

HTH

Elton Wang
 
R

rodg12

Thanks for the reply Elton. This would solve my problem with the link
but wouldn't help with with the sort problem. Any idea what I could do
there??
 
R

rodg12

I click on the header row to sort a column and after the page reloads
with the datagrid sorted, the back button on the browser is disabled.
I can't go back to the search page, I'm stuck on the results page with
the data sorted. The crazy thing is that it works just fine in a
Mozilla browser (back button doesn't get disabled), but does not work
right in IE (back button disables). It's possible this is just a bug
with IE, but I'm not sure of that. The page is still listed in my
history so the history isn't being purged or something like that either.
 
E

Elton Wang

I don't think it's IE problem. My IE works fine with Back button (after
datagrid sorting). And it's first time I heared the problem. Although I'm
not sure what causes the problem, check your IE settings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top