Pop up window in telerik

10 posts, 0 answers
  1. Vitaly
    Vitaly  avatar
    68 posts
    Member since:
    Aug 2011

    Posted 16 Aug 2012 Link to this post

    Good afternoon,
    I have switch statement where based on the value pop up error message.This is just plain message.I want something nice looking window on the server side.
    Here is my coding in .cs file:

     

    switch

     

     

    (Flagout)

     

    {

    case

     

     

    "F":

     

     

     

    ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('Job issue.Please try again later.');", true);

     

     

     

    break;

     

     

     

    case "S":

     

     

     

    ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('System error.Please try again later.');", true);

     

     

     

    break;

     

    case

     

     

    "V":

     

     

     

    ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('Security violation.You cannot approve this record.');", true);

     

     

     

    break;

     

     

     

    }
    Please help me.
    Thanks so much.

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

    Posted 16 Aug 2012 Link to this post

    Hi Vitaly,

    One suggestion is that you can call a RadAlert from codebehind as follows.

    ASPX:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>

    C#:
    switch(Flagout)
     {
      case "F":
               string scriptstring = "radalert('Job issue.Please try again later.', 250, 80,'Information');";
               ScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true);
               break;
      case "S":
               string scriptstring = "radalert('System error.Please try again later.', 250, 80,'Information');";
               ScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true);
               break;
      case "V":
               string scriptstring = "radalert('Security violation.You cannot approve this record.', 250, 80,'Information');";
               ScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true);
               break;
     }

    Hope this helps.

    Regards,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vitaly
    Vitaly  avatar
    68 posts
    Member since:
    Aug 2011

    Posted 17 Aug 2012 Link to this post

    Thanks so much for your help.
    One more thing.I need popup confirmation window when I am getting value 'Y' that is means everything is ok.
    Please help me.

    Thanks so much
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 Aug 2012 Link to this post

    Hi Vitaly,

    You can call a confirm call back function as shown below.
    JS:
    function confirmCallBackFn(arg)
    {
      radalert("<strong>radconfirm</strong> your message here: <h3 style='color: #ff0000;'>" + arg + "</h3>", null, null, "Result");
    }

    Thanks,
    Shinu.
  6. Vitaly
    Vitaly  avatar
    68 posts
    Member since:
    Aug 2011

    Posted 20 Aug 2012 Link to this post

    Good morning Shinu,
    Thanks for your respond.I coded like you suggested to me but I am getting 2 confirm message.I need it one.
    Here is my code in .cs file:

    case "Y":

     

    RadWindowManager1.RadConfirm(

     

    "This action will approve the selected record. Are you sure?", "confirmCallBackFn", 300, 100, null, "Confirmation Message");

     

    lblApprMsg.Text =

     

    "Record has been approved successfully";

     

    lblApprMsg.Visible =

     

    true;

     

    ReadAndBindCfnData();

    And here is my code in aspx file:
    radalert("<strong>radconfirm</strong> returned the following result: <h3 style='color: #ff0000;'>" + arg + "</h3>", null, null, "Result");

    But once again in this case I am getting two messages:
    1.This action will approve the selected record.Are you sure?.
    2.radconfirm returned the following result:true/false.

    I need just one message saying:
    This action will approve the selected record.Are you sure?
    And when user click "Cancel Button" it should not approve the record.
    And when user click "OK Button" it should approve the record.

    Thanks so much for your help.

     

  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 21 Aug 2012 Link to this post

    Hello Vitaly,

    I advise that you examine the following help article that explains how to achieve such a scenario: http://www.telerik.com/help/aspnet-ajax/window-using-radconfirm-in-server-code.html.


    Greetings,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Vitaly
    Vitaly  avatar
    68 posts
    Member since:
    Aug 2011

    Posted 22 Aug 2012 Link to this post

    Good morning,
    thanks so much for your respond I did postback and it is working fine but I do not really need postback.I need when user click confirm 'Yes' just do it without postback.Here is my coding in aspx page:

    <

     

     

    telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"

     

     

     

    Skin="Vista" >

     

     

     

    </telerik:RadWindowManager>

     

     

     

    <asp:Button ID="Button1" runat="server" CssClass="buttons" Text=" " OnClick="Button1_Click" />

     

     

     

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

     

     

     

    <script type="text/javascript">

     

     

     

    function confirmCallbackFn(arg) {

     

     

     

    if (arg) //the user clicked OK

     

    {

    __doPostBack(

     

    "<%=Button1.UniqueID %>", "");

     

     

     

    }

    }

     

     

    </script>

     

     

     

    </telerik:RadCodeBlock>

     


    And when I try to put instead of _doPostBack something like that:

    $find(

     

    "<%=Button1.UniqueID %>").click();

     

     

    I am getting js error on the runtime:
    Line: 204
    Error: 'null' is null or not an object

    Thanks so much for your help.
    Vitaly.

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

    Posted 23 Aug 2012 Link to this post

    Hi,

    Try accessing the button as shown below.
    JS:
    var btn=document.getElementById("Button1");

    Thanks,
    Shinu.
  10. Ratan
    Ratan avatar
    1 posts
    Member since:
    Jan 2014

    Posted 01 Feb 2014 Link to this post

    I am making a PopUp window in telerik. when page upload first then  popup size is Ok aftre that if I reopen  that window then its size become small. means size become decrease when second time we open page. My code is below.

    ​<telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
            ReloadOnShow="true" runat="server" Skin="Hay" EnableShadow="true" AutoSize="false"
            KeepInScreenBounds="true" Behaviors="Default" MaxHeight="1000">
            <Windows>
                <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Default" Height="600px" Width="800px" AutoSize="false">
                </telerik:RadWindow>
                <telerik:RadWindow ID="RadWindow2" runat="server" Behaviors="Default" Width="540px" Height="550px" >
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
  11. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 03 Feb 2014 Link to this post

    Hello Ratan,

    With this markup there is no reason for such behavior, yet here is what I can advise:

    1) see if you set the DestroyOnClose property to true anywhere. It will remove the incance once it closes, so the next time you open it it will have the default settings (i.e., 300px by 300px size)

    2) even if this is not the case, you can always use the control's client-side API to set its size (via the setSize(width, height) method) after you show it: http://www.telerik.com/help/aspnet-ajax/window-programming-opening.html, or use the additional arguments radopen() offers.

    3) see if you have more than one RadWIndowManager on the page, because you may simply be opening another dialog, not the one you expect: http://www.telerik.com/help/aspnet-ajax/radwindow-troubleshooting-wrong-window-opened.html.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017