Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 04, 2012 12:53 AM by afire007
Aug 02, 2012 10:18 PM|LINK
Hey guys I have a wierd problem that I cant seem to figure out.
I have two aspx pages and when I try to link between them wierd things happen. Ill try and explain the situation to the best of my ability.
This is step by step exactly my test scenario.
Report.aspx - Multiview with two views (View1,View2)
ActiveViewIndex = 0 in MultiView tag
user enters query on View1 and clicks the search button (ASP Server Button)
Redirects to View2, displays results
User clicks on a result (Each result is an <a href> with a query string which redirects to ReportDetails.aspx)
ReportDetails.aspx - Multview with two views (View1,View2)
Displays a detailed description of that result from the previous page
User clicks on a button that is supposed to redirect to View2 from View1 (ASP server button)
Redirects back to Report.aspx
It doesnt even register the button click event for some reason. It just redirects to the previous page no matter what I put in the event click.
Aug 02, 2012 10:57 PM|LINK
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim activeview As Integer = 0
activeview = Request.QueryString("activeview")
Catch ex As Exception
MultiView1.ActiveViewIndex = activeview
response.redirect("report.aspx?activeview=" & request.querystring("activeview") & "&reportid=" & reportid)
Aug 03, 2012 12:29 AM|LINK
Doesnt work unfortunatly.
on ReportDetails.aspx page if I refresh the page (causing another post back) and then click the button on the page it works properly. This isnt really a fix but the current situation.
If i dont refresh the page and click the button on ReportDetails.aspx it redirects to the previous page Report.aspx page and completely ignores the server side onclick event for that button.
It seems like the viewstate is somehow persisting from Report.aspx to ReportDetails.aspx.
Aug 03, 2012 12:50 AM|LINK
I think you can use no redirect command.
you can change view1 to view2 by change activeview value.
and using hyperlink to otherpage (no redirect)
Aug 03, 2012 02:19 PM|LINK
Thats what I am currently doing I believe.
Report.aspx links to ReportDetails.aspx through standard <a href> tags with a query string that do not contain runat="server". (Should they be?)
When the user clicks on the button in ReportDetails.aspx to change to View2 I am not using a Response.Redirect, I am using Multiview1.SetActiveView(View2)
ActiveViewIndex = 0 by default in the tag (View1 is shown)
User Clicks "Search button" in View1
load results from query and display
User clicks on one of the <a href> links which redirects to ReportDetails.aspx with a query string
ActiveViewIndex = 0 by default (View1 is shown)
User clicks on "Email User" button
Site for some reason posts back to ReportDetails.aspx.
Wouldn't it make more sense that the viewstate from Report.aspx is persisting?
I feel more or less the issue has to do with the fact that the viewstate from Report.aspx is persisting even when I redirect to ReportDetails.aspx. Thus when I click ANY button on ReportDetails.aspx it doesnt even register the onclick even for it, it just
immediatly posts back to the Report.aspx page.
Its only if I Refresh ReportDetails.aspx does everything work properly on it.
Aug 03, 2012 11:09 PM|LINK
Anyone know what the issue may be I still seem to be struggling to figure out how to fix this.
Aug 04, 2012 12:53 AM|LINK
never mind guys I figured it out. One of my ajax functions was actually causing the problem with an additional postback that was messing up my page.
I do appreciate the help though! It was a fairly annoying and complicated problem I assumed it was in the viewstate.