Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
6 views

I am implementing a one time password with google authenticator for login page. After checking the user id and password is correct, I need to hidden the login box and show the QR code, OTP textbox and submit button. I saw sample using Panel.visible = true/false to switch. It is work in Page_Load to set default Panel_GoogleAuth.visible = false, but it is not work in the login button onClick event. It can't show the Panel_GoogleAuth and just hidden the login button but not the whole Panel_Login. Does anyone know why?

My reference: Sample

aspx:

<asp:Panel ID="Panel_GoogleAuth" runat="server" Font-Names="Arial" Font-Size="12pt" HorizontalAlign="Center" Width="1024px">
    <div class="row">
        <div class="col-3"></div>

        <div class="col-5">
            <fieldset class="TOTP">
                <asp:Label ID="lblScanQRCode" runat="server" Style="padding-top: 4px">Sceen the QR Code in Google Authenticator</asp:Label>
                <br />

                <asp:Image ID="imgQRCode" runat="server" Width="200" Height="200" />
                <asp:HiddenField ID="hfSecretKey" runat="server" />
                <br />
                <asp:TextBox ID="txtOTP" runat="server" placeholder="Enter One-Time-Password"></asp:TextBox>
                <asp:Button ID="btnVerify" runat="server"Text="Verify OTP" />
                <br /><br />
                <asp:Label ID="lblMessage" runat="server"></asp:Label>
            </fieldset>
        </div>
    </div>
</asp:Panel>


<telerik:RadAjaxPanel ID="StaffPanel" runat="server" Width="99%">
    <div id="wrap-content">
        <asp:Panel ID="Panel_Login" runat="server" Font-Names="Arial" Font-Size="12pt" HorizontalAlign="Center" Width="1024px">
            <asp:Login ID="LoginUser" Class="Login" runat="server" EnableViewState="false" RenderOuterTable="false">
                <div class="accountInfo">
                    <div class="row">
                        <div>
                            <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Staff ID:</asp:Label>
                        </div>
                        <div>
                            <asp:TextBox ID="UserName" runat="server" CssClass="textEntry" Width="114%" Height="20"></asp:TextBox>
                        </div>
                    </div>

                    <div class="row">
                        <div>
                            <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" Style="padding-top: 4px">Password</asp:Label>
                        </div>
                        <div>
                            <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password" Width="114%" Height="20"></asp:TextBox>
                        </div>
                    </div>

                    <div class="row">
                        <telerik:RadButton ID="btnLogin" runat="server" Text="Login" OnClick="RadButton_LoginCheck_Click" RenderMode="Lightweight" Width="93%" Font-Size="X-Large" Skin="Silk" Height="35px" Font-Names="Arial"></telerik:RadButton>
                    </div>
                </div>
            </asp:Login>
        </asp:Panel>
    </div>
</telerik:RadAjaxPanel>

aspx.vb:

Protected Sub btnLogin_Click(sender As Object, e As System.EventArgs) Handles btnLogin.Click
    If staffIDRegex.Match(checkStaffId).Success Then
        Panel_Login.Visible = False
        Panel_GoogleAuth.Visible = True
    End If
End Sub

Rumen
Telerik team
 answered on 12 Sep 2025
2 answers
331 views
I have a RadPanelBar with an RadPanelItem collection declared in the markup (it's not built dynamically).  On the page load in the codebehind, I disable all but the first panel item.  I disable panel items like this:

RadPanelBar1.FindItemByValue("Quantity").Enabled = false;

Then, when a RadGrid row is double-clicked in first, enabled RadPanelItem, I use the RadGrid's client-side API to enable the next panel item via Javascript.  The Javascript performs as expected and enables the panel item, but all of the controls within the newly enabled panel are disabled.

I just discovered this after making a modification to a page.  Previously, we set these panels to disabled via Javascript using the following code:

panel.findItemByValue("PriceStructure").disable();

This disabled only the panel item itself and not the controls within the panel item.  However, now we need to disable these in the codebehind, but all the controls within the item become disabled.

How do I keep this from happening when disabling panel items in the codebehind?
Attila Antal
Telerik team
 answered on 13 Apr 2023
2 answers
216 views
I have been trying for a couple of days now to get my PanelBar working with databound items, where the item template consists of a user control.  Here is my code:

<telerik:RadPanelBar runat="server" ID="pbSupplierAgreements" AllowCollapseAllItems="true"                 OnItemDataBound="pbSupplierAgreements_ItemDataBound" ExpandMode="SingleExpandedItem"                        Width="100%" DataValueField="ID" DataTextField="SupplierCode" DataTextFormatString="Supplier: {0}">
  <ItemTemplate>
    <telerik:RadPanelItem>
      <Items>
        <telerik:RadPanelItem>
          <ItemTemplate>
            <e:SupplierAgreementView ID="SupplierView" runat="server" />
          </ItemTemplate>
        </telerik:RadPanelItem>
      </Items>
    </telerik:RadPanelItem>
  </ItemTemplate>
</telerik:RadPanelBar>

When the OnItemDataBound is called I bind the data item to the SupplierAgreementView control.

The problem is that this renders the control and data ok , but the panel bar items are all expanded but I can't collapse them and there is no collapse button on the panel bar item headers.

Please help!
Attila Antal
Telerik team
 answered on 29 Dec 2022
0 answers
242 views
I have a PanelBar that is tied to a sql server stored procedure. In my stored procedure, I am working out the users who should see certain panel items, so I have a field called "Item_Visible". Is there a way to get each item to pull from what I am returning in my stored procedure are mark the items visibility based on that field? 
Angela
Top achievements
Rank 1
Iron
 asked on 18 Aug 2022
1 answer
217 views

Hello

I am looking for a way to add a control to my radpanelbarItems.
I would like to keep all the "free" functionalities of the panelbaritem (img, hoverimage, text, expand/collapse , default styling etc) so i prefer not using templates.

I populate the radpanelbar from codebehind as demonstrated in attached code.

My first try is simply to add the control and move it in place using css.  But unfortunately the content area of the panelbaritem keeps it height, smashing the layout of the panels.


any hint would be highly appreciated , either to making the attached example work or a different approach.

kind regards

Mark


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>   

    <style>
        .myimg {
            position: relative !important;
            top: -30px !important;
            left: 100px !important;
        }
    </style>

</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>
            </Scripts>
        </telerik:RadScriptManager>
    
            <div>

            <telerik:RadPanelBar ID="RadPanelBar1" runat="server" ExpandMode="SingleExpandedItem" Skin="Bootstrap" Width="300">
                <Items>
                </Items>
            </telerik:RadPanelBar>

        </div>
    </form>
</body>
</html>




using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

public partial class test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        FillPanels();
    }

    protected void FillPanels()
    {

        for (int i = 0; i < 10; i++)
        {
            RadPanelItem ProductPanel = new RadPanelItem { Text = "P" + i.ToString(), Expanded = false, ImageUrl = "/images/prod_notok.png", Value = "P" + i.ToString() };

            //add control try
ProductPanel.Controls.Add(new Image { ImageUrl = @"/images/pdf.png",CssClass="myimg",ID="img" + i.ToString() }); for (int h = 0; h < 3; h++) { RadPanelItem SubPanel = new RadPanelItem { Text = "S" + i.ToString() + h.ToString(), ImageUrl = "/images/notok.png", Expanded = false, Value = "S" + h.ToString() + i.ToString() }; ProductPanel.Items.Add(SubPanel); } RadPanelBar1.Items.Add(ProductPanel); } } }

Attila Antal
Telerik team
 updated answer on 04 May 2022
1 answer
89 views

Regardless of browser, when you zoom out to text size 80% or less the text in the RadPanelBar disappears. 

Is there a way to make the text visible regardless of the zoom level?

/POE

Vessy
Telerik team
 answered on 26 Jan 2022
0 answers
99 views
Nevermind
Peter
Top achievements
Rank 1
 updated question on 24 Jan 2022
1 answer
142 views

I made a sliding panal as your example but with a little deferent that the panel in (OCX) user Control , it work fine but the problem is that it start in an open position , i want it to start closed and be opened when i click the button . my code is :

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

       <%-- <script src="scripts.js" type="text/javascript"></script>--%>
 <%-- /**/--%>

        <script type="text/javascript">
            Sys.Application.add_load(function() {

                demo.rightPanel = $get('<%=RadPanelBar2.ClientID %>');
              <%--  demo.rightButton = $get('<%=rightbutton.ClientID %>');--%>
                demo.rightButton = document.getElementById("rightbutton");

              <%--  demo.rightButton = $find("<%=rightbutton.ClientID %>");--%>

                demo.initialize();
            });
        </script>
    </telerik:RadScriptBlock>

<div class="right-pane">
            <input type="image" id="rightbutton" class="button" src="../images/ElmosamenIcon.png" />

   <%--  <telerik:RadButton RenderMode="Lightweight" ID="rightbutton" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"
                        Width="53px" Height="53px" AutoPostBack="false" ForeColor="Black" Checked="true" >
                        <ToggleStates>
                            <telerik:RadButtonToggleState ImageUrl="../images/ElmosamenIcon.png" HoveredImageUrl="../images/ElmosamenIcon.png"
                                Text="Play" Selected="true"></telerik:RadButtonToggleState>
                            <telerik:RadButtonToggleState ImageUrl="../images/ElmosamenIconclosed.png" HoveredImageUrl="../images/ElmosamenIconclosed.png"
                                Text="Pause"></telerik:RadButtonToggleState>
                        </ToggleStates>
                    </telerik:RadButton>--%>

            <div class="sliding-pane">
            <telerik:RadPanelBar RenderMode="Lightweight" ID="RadPanelBar2" runat="server"  Width="200px"  skin="BlackMetroTouch" Height="605px"  ExpandMode="FullExpandedItem" 
             DataSourceID="SqlDataSource1" DataFieldID="id" DataFieldParentID="ParentId" DataTextField="Text" DataNavigateUrlField="HyperLink" ViewStateMode="Enabled">
            <DataBindings>
                <telerik:RadPanelItemBinding  Depth="0" ImageUrl="ImageURL"  Expanded="true"  />
            </DataBindings>
        </telerik:RadPanelBar>


            </div>
        </div>

 

with  a java script code as

(function () {
    var demo = window.demo = window.demo || {};



    demo.initialize = function () {


        var rightPanel = demo.rightPanel;
        var rightButton = demo.rightButton;

        if (rightPanel) {
            SetUpAnimation(rightButton, Telerik.Web.UI.jSlideDirection.left, rightPanel);
        }
    }

    window.SetUpAnimation = function (button, direction, element) {
        element.style.position = "relative";

        var expanded = true;

        var expandAnimation = new Telerik.Web.UI.AnimationSettings({});
        var collapseAnimation = new Telerik.Web.UI.AnimationSettings({});

        var slide = new Telerik.Web.UI.jSlide(element, expandAnimation, collapseAnimation, false);

        slide.initialize();

        slide.set_direction(direction);

        button.onclick = function () {
            element.parentNode.style.visibility = "visible";
            element.parentNode.style.display = "block";
            if (!expanded) {
                slide.expand();
            }
            else {
                slide.collapse();
            }
            expanded = !expanded;
            return false;
        }
    };
}())

I also try to use a Rad button with type  ToggleButton  to change the button image when i click the button , it work well but the problem it is appear in the left side of the sliding panel

 

                                                        
Vessy
Telerik team
 answered on 19 Nov 2021
1 answer
669 views

 

I have a panel bar in my application. The use case with my application is, I wanted to change the color of Panel bar when my project goes through various stages, Ex: Stage 1,2,3,4. May be like

For Stage 1: Red,

Stage 2: Orange,

Stage 3: Blue,

Stage 4: Green

Is this possible? If possible how to do it.

Thanks,

SC

 

 

 

 

 

Peter Milchev
Telerik team
 answered on 27 Nov 2020
3 answers
169 views
Hi,

We are working on a RadPanelBar upgrade initiative. We are currently using RadPanelbar.Net2 (v2.0.50727) and want to upgrade it to the latest version (Latest Version is 2020.2.617).

The problem we are facing at the moment is:

- RadPanelBar requires Script Manager added to the page. In our implementation RadPanelBar is added to Master Page and so it requires a form tag having Script Manager on it.
- Some of the child pages in our case don't have form on them but there are instances where Child pages do have form on them. So, in these cases application stops working because the child page form becomes nested.
- We tried to resolve nested form issue by dynamically creating Form from Code-behind but it is not working as per expectations.

Is there any possibility to use RadPanelBar without Script Manager - this way it will become the save as of v2.0.50727?
Peter Milchev
Telerik team
 answered on 15 Sep 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?