CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums



Zone: > Asp.Net Forum > asp.net_ajax.asp.net_ajax_ui Tags:
Item Type: Date Entered: 1/8/2008 3:41:38 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 8 Views: 1069 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
9 Items, 1 Pages |< << Go >> >|
"jen_bonnett" <
NewsGroup User
Response.Redirect cannot be called in a page callback error message.10/4/2007 9:16:32 PM

0

Hi.  I'm using the Dundas Chart Controls in VS 2005.  These controls are built utilizing AJAX.  I have a basic page with a dundas chart control containing a funnel chart.  The funnel contains Quotes, Sales Orders and Invoices.  When the user clicks on the control, I want to determine whether they clicked on Quotes, Sales Orders or Invoices and transfer to the appropriate Details Page.  I've got the code working to determine which transaction type they clicked on; but, I get the "Response.Redirect cannot be called in a page callback." error when the page tries to redirect.  Note: I get a similar issue if I try server.transfer.

Suggestions?

 Here's my code:

Dim hitTestResult As Dundas.Charting.WebControl.HitTestResult = Chart1.HitTest(e.X, e.Y)

            If Not (hitTestResult Is Nothing) Then

                Dim clicked As Dundas.Charting.WebControl.DataPoint = hitTestResult.Series.Points(hitTestResult.PointIndex)

                Select Case hitTestResult.PointIndex
                    Case 0

                        Response.Redirect("COQuotes.aspx")
                    Case 1
                        Response.Redirect("COOrders.aspx")
                    Case 2
                        Response.Redirect("COOrders.aspx")

                End Select


            End If
"dwhite" <>
NewsGroup User
Re: Response.Redirect cannot be called in a page callback error message.10/4/2007 10:36:41 PM

0

Since it's a partial postback that is occuring, you can't use Response.Redirect.  You need to do a full postback in order to redirect or use a different method. See the last message in this post: http://forums.asp.net/t/1165851.aspx

-Damien

 


** Remember to mark posts as the answer to help future users. **
Visoft, Inc - Web Site | Blogs
"jen_bonnett" <
NewsGroup User
Re: Response.Redirect cannot be called in a page callback error message.10/5/2007 3:43:57 PM

0

I have no control over the callback.  It is being executed by the Dundas Control.  I tried implementing the code with the RegisterClientScript, as below.  But, nothing happens...

 

Dim hitTestResult As Dundas.Charting.WebControl.HitTestResult = Chart1.HitTest(e.X, e.Y)

            If Not (hitTestResult Is Nothing) Then

                Dim clicked As Dundas.Charting.WebControl.DataPoint = hitTestResult.Series.Points(hitTestResult.PointIndex)

                Select Case hitTestResult.PointIndex
                    Case 0
                        clientRedirect("COQuotes.aspx")
                    Case 1
                        clientRedirect("COOrders.aspx")
                    Case 2
                        clientRedirect("COOrders.aspx")

                End Select

Sub clientRedirect(ByVal URL)
        Dim jScript As String

        jScript = String.Format("document.location.href = '{0}');", URL)
        ClientScript.RegisterClientScriptBlock(Page.GetType(), "redirect", jScript, True)
   
    End Sub
  

 

"dwhite" <>
NewsGroup User
Re: Response.Redirect cannot be called in a page callback error message.10/5/2007 4:03:01 PM

0

Give RegisterStartupScript a try. See http://blogs.ittoolbox.com/c/coding/archives/registerclientscriptblock-and-registerstartupscript-17321 for some more info.

-Damien


** Remember to mark posts as the answer to help future users. **
Visoft, Inc - Web Site | Blogs
"jen_bonnett" <
NewsGroup User
Re: Response.Redirect cannot be called in a page callback error message.10/5/2007 4:29:10 PM

0

Tried RegisterStartupScript, still nothing happens.

 

Jennifer

"dj_sdix" <>
NewsGroup User
Re: Response.Redirect cannot be called in a page callback error message.10/5/2007 5:18:41 PM

0

Hi,

I'm not familiar with dundas chart but is there no way to setup a href on a chart element during rendering? I would have thought this would be a standard feature.

Back to your Response.Redirect problem. When you get a response from the callback can you control the client-side callback function? If so you could use the cookie method as in the last post. If you have no control over the client-side callback function I  very much doubt your going to be able to add the functionality you require.

One minor point, if your re-directing anyway whay do you need to use ajax, you could do a page post back when clicking the chart, do your logic and then redirect. To the user the behavior would seem exactly the same as your moving to a different page anyway.

Cheers Si

"mrmercury" <>
NewsGroup User
Re: Response.Redirect cannot be called in a page callback error message.10/5/2007 5:24:06 PM

0

You won?t be able to use Response.Redirect() or Server.Transfer() in a callback, check if the control has a client event you can use instead, if that event exists you could use window.location.replace("OtherPage.aspx"); using JavaScript from the client to move to another page.
"It's so good to know there's still a little magic in the air"
Brian May.
"markslade24" <
NewsGroup User
Re: Response.Redirect cannot be called in a page callback error message.1/8/2008 3:21:58 PM

0

When you setup the chart set the RenderType to 'InputTag' this causes the chart to do a full postback and hence Response.Redirect shoud work (if the Chart is inside an update panel you will need to register the Click event of the chart and a postback trigger in the update panel)

objChart.RenderType = Dundas.Charting.WebControl.RenderType.InputTag

 

"phsika" <>
NewsGroup User
Re: Response.Redirect cannot be called in a page callback error message.3/7/2008 2:54:16 PM

0

Hi; i want to create a graph that's related to dundas charting. Firstly i am from Turkey; and your Question's interested me so i like to ask this Question: My chart describes wage distribution on months(jun,jully,agust etc) if i click, i want to direct jully.aspx like this. But Clicking is not working properly. For exmp; i want to see clicking cord. Textbox1.Text=e.X .tostring(),Textbox2.Text=e.Y.tostring()  and also direction is sick(jully.aspx). Would you like me help with my problems?

Codes:

 

using Dundas.Charting.WebControl;

using System.Drawing.Drawing2D;

public partial class _Default : System.Web.UI.Page

{

DataPoint clicked;

protected void Page_Load(object sender, EventArgs e)

{


Chart1.Series["haziran"].Points.AddXY(2, 3);

Chart1.Series["temmuz"].Points.AddXY(1, 2);

Chart1.Series["agustos"].Points.AddXY(4, 5);


}

protected void Chart1_Click(object sender, ImageClickEventArgs e)

{

clicked = new DataPoint();

HitTestResult hittestresult = Chart1.HitTest(e.X, e.Y);

TextBox1.Text = e.X.ToString();

TextBox2.Text = e.Y.ToString();

if (hittestresult == null)

{

clicked = hittestresult.Series.Points[hittestresult.PointIndex];

switch (hittestresult.PointIndex)

{

case 84:

{

Response.Redirect("haziran.aspx");

break;

}

}

}

 

}

  

9 Items, 1 Pages |< << Go >> >|



Free Download:






   
  Privacy | Contact Us
All Times Are GMT