This is a migrated thread and some comments may be shown as answers.

RadButton as Linkbutton relative NavigateUrl

1 Answer 124 Views
Button
This is a migrated thread and some comments may be shown as answers.
Fit2Page
Top achievements
Rank 2
Iron
Iron
Veteran
Fit2Page asked on 20 Jan 2020, 10:43 AM

Hi,

 

I get an error [HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]

with:

    <telerik:radButton ButtonType="LinkButton" NavigateUrl="~/shop/shoppingcart.aspx" id="btn_nextsteptop" runat="server"><ContentTemplate>
        <asp:Literal ID="Literal1" Text="Jippeee" runat="server"></asp:Literal></ContentTemplate></telerik:radButton>

 

When I remove the tilde then the error is not occuring, so probably the relative path functionality is broken here?

 

Marc

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 22 Jan 2020, 01:41 PM

Hello,

This might be related to the following bug: 

You can try either removing the tilde in the URL or resolving the URL in the button's Load event:

protected void RadButtons_Load(object sender, EventArgs e)
{
    (sender as RadButton).NavigateUrl = this.ResolveUrl((sender as RadButton).NavigateUrl);
}

<telerik:RadButton runat="server" ID="RadButton1" ButtonType="StandardButton" NavigateUrl="~/App/Home.aspx" Text="Home" OnClick="RadButton1_Click" OnLoad="RadButtons_Load" AutoPostBack="true" />
Regards,
Peter Milchev
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Tags
Button
Asked by
Fit2Page
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Peter Milchev
Telerik team
Share this question
or