We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Performing a postback to a different .aspx page.

Thread ID:

Created:

Updated:

Platform:

Replies:

146989 Aug 27,2019 09:11 PM UTC Aug 30,2019 09:24 AM UTC ASP.NET Web Forms 3
loading
Tags: Tab
Matt Broich
Asked On August 27, 2019 09:11 PM UTC

Hello,

Is it possible to perform a Response.Redirect() on an ej-button click event within a tab to another page? I am using Ajax to load external aspx pages so users can edit a specific element (in tabs) then click a save button. However, when a click occurs, the postback is to the tab's url. 

Any insight would be fantastic.

Thank you!

Ashokkumar Balasubramanian [Syncfusion]
Replied On August 28, 2019 08:46 AM UTC

Hi Matt,  
 
Good day to you. 
 
Yes, you can perform a Response.Redirect on ejButton click. We have rendered a button with “button” type inside Tab and redirected to another aspx page through server side click event. Please refer to the following code 
 
<ej:Tab ID="tabButton" runat="server"> 
    <Items> 
        <ej:TabItem ID="button" Text="Button"> 
            <ContentSection> 
                <ej:Button ID="redirect" Type="Button" Text="Redirect" OnClick="Redirect_Click" runat="server"></ej:Button> 
            </ContentSection> 
        </ej:TabItem> 
        .  . . . . 
    </Items> 
</ej:Tab> 
 
Aspx.cs: 
protected void Redirect_Click(object Sender, Syncfusion.JavaScript.Web.ButtonEventArgs e) 
        { 
            Response.Redirect("~/Default.aspx", true); 
        } 
 
Sample can be downloaded from the following link 
 
 
Kindly check the provided sample and revert us, if you need any further assistance. 
 
Regards, 
Ashokkumar B. 


Matt Broich
Replied On August 29, 2019 03:29 PM UTC

Hi Ashokkumar,

Sadly this did not work. 

Let me clarify:

Here is my tab markup: 
               <ej:Tab ID="Tab" runat="server" EnableTabScroll="true" Width="100%" Height="900px" HeightAdjustMode="Content"></ej:Tab>
Here is the code behind: 

                foreach (var pageItem in pageItems)
                {
                    string url = String.Format("{0}?pkid={1}&siteid={2}", pageItem.AbsoluteUrl, ViewState["pkid"].ToString(), ViewState["siteid"].ToString());
                    Tab.Items.Add(new Syncfusion.JavaScript.Web.TabItem { Text = pageItem.Name, Url = url });
                }

Each tab is dynamically created from our database. However, since these pages are being loaded in through AJAX, I have no control over the postback url. Whenever I click a save/update button in a tab, the page reloads specifically to that tab's content. Instead of the Response.Redirect navigating me back to the page containing the tabs, it navigates me to the tab's url. I have made a workaround using an AJAX POST call in the .aspx page, however, I would much rather use the code behind to store my server code. 

Thank you!

Ashokkumar Balasubramanian [Syncfusion]
Replied On August 30, 2019 09:24 AM UTC

Hi Matt, 
 
We have included a tab item dynamically during page load. Redirect action works fine in our end. Please refer to the below sample and video links 
 
 
 
Also, we are not clear about where the tab items are added dynamically. Initially at page load? or during some AJAX action? If it is added during page load, then IsPostBack condition should be checked there. Please check the above sample and if issue persists, kindly modify the above sample based on your code else share us your complete code snippet along with a video (if possible) so that we can proceed further. 
 
Regards, 
Ashokkumar B. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon