Dynamically Set NavigateUrl

7 posts, 0 answers
  1. Kris
    Kris avatar
    20 posts
    Member since:
    Jun 2010

    Posted 21 Sep 2010 Link to this post

    Not sure what I am doing wrong here.

    <telerik:RadPanelItem runat="server" Font-Bold="True" ForeColor="White" 
        NavigateUrl="https://site.com/app/default.asp?M=2-3&u=<%= uUser_id%>" 
        Text="Event Application"> 
    </telerik:RadPanelItem>
      
    Trying to pass the current user ID but I pass: 
      
    instead of: 
      
    Any ideas?
      
    ASP programer learning ASPX 

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Sep 2010 Link to this post

    Hello,


    I believe setting the NavigateUrl from code behind is better option than setting it from aspx. Access the PanelItem using FindItemByText/FindItemByUrl/FindItemByValue method and set the NavigateUrl and url parameter.


    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 22 Sep 2010 Link to this post

    Hello Kris,

    You can set it like this instead:

    NavigateUrl="<%# String.Format("https://site.com/app/default.asp?M=2-3&u={0}", uUser_id)%>"

    I hope that helps.
  5. Kris
    Kris avatar
    20 posts
    Member since:
    Jun 2010

    Posted 23 Sep 2010 Link to this post

    This is what I ended up doing.  But now the menu is doubled.
     
    So the next question why is it doubled?
    ascx code
      
    <%@ Control language="vb" Inherits="dotnetnuke.aau.aauplaymenu.View" AutoEventWireup="false" Explicit="True" Codebehind="View.ascx.vb" %>
      
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
      
      
    <link href="module.css" rel="stylesheet" type="text/css" />
    <telerik:RadPanelBar runat="server" ID="RadPanelBar1"  Skin="Black" 
        Width="228px" ExpandMode="SingleExpandedItem">
         
    </telerik:RadPanelBar>
      
      
    ascx.vb Code
      
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load
            Try
      
                If Not Page.IsPostBack Then
                    ReadRecordAndSetupPage()
                End If
      
            Catch exc As Exception        'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub
      
           Protected Sub ReadRecordAndSetupPage()
      
                uUser_id = getuUser_id()
                Dim RT_Home As New RadPanelItem()
                RT_Home.Text = "Home - Summary Page"
                RT_Home.ForeColor = Color.GreenYellow
                RT_Home.Font.Bold = True
                RT_Home.NavigateUrl = "~/home.aspx"
                RadPanelBar1.Items.Add(RT_Home)
      
                Dim RT_Athlete As New RadPanelItem()
                RT_Athlete.Text = "Athlete Application"
                RT_Athlete.ForeColor = Color.GreenYellow
                RT_Athlete.Font.Bold = True
                RT_Athlete.NavigateUrl = "~/Athlete.aspx?sCat=A"
                RadPanelBar1.Items.Add(RT_Athlete)
    ...
           End Sub
  6. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 27 Sep 2010 Link to this post

    Hi Kris,

    Could you, please, specify what exactly do you mean by "the menu is doubled"?
    Please, try to specify the problem you currently experience and I will do my best to resolve it!

    Hope that soon we will solve this!


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Kris
    Kris avatar
    20 posts
    Member since:
    Jun 2010

    Posted 27 Sep 2010 Link to this post

    What I mean is that the menu repeats it's self.
  8. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 30 Sep 2010 Link to this post

    Hi Kris,

    Your user control is the menu, I saw that just now. Sorry about that! Whenever I read "menu", I think about RadMenu control.

    Now, on the problem:
    - If the user control is being doubled on the page you declare it, then probably it's being instantiated a second time later on the page lifecycle. Could you, please, open a support ticket and provide me with a runnable project? This will save a lot of time in correspondence and will contribute to solving this problem faster.

    Hope that soon you will submit the ticket and I will have a sample project to debug!


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017