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

RADPROMPT

2 Answers 98 Views
Window
This is a migrated thread and some comments may be shown as answers.
Abdul Kadar
Top achievements
Rank 1
Abdul Kadar asked on 10 Oct 2009, 10:37 AM
Hi,
I need to display the radprompt from codebehind(vb).My Scenario is , when the user clicks the Delete link button, I need to call the radprompt (code-behind) .and getting the reason for delete.how can i display the radprompt and getting the values entered in the radprompt window using codebehind(vb).Thanks in advance.
Regards
Kadar

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Oct 2009, 05:27 AM
Hi Abdul Kadar,

Here is the code that I tried to call RadPrompt from code behind and retrieve the result on server. Here I used a invisible button to invoke postback and in RaisePostBack event, retrieves the result of RadPrompt.

CSS:
 
    <style type="text/css"
        .MyButton 
        { 
            displaynone
        } 
    </style> 

ASPX:
 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"
</telerik:RadWindowManager> 
 
<asp:ScriptManager ID="ScriptManager1" runat="server"
</asp:ScriptManager> 
 
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Delete" /> 
 
<asp:Button ID="Button2" CssClass="MyButton" runat="server" Text="Button" OnClick="Button2_Click" /> 

VB:
 
Protected Sub Button2_Click(ByVal sender As ObjectByVal e As EventArgs) 
     
End Sub 
Protected Overloads Overrides Sub RaisePostBackEvent(ByVal source As IPostBackEventHandler, ByVal eventArgument As String
    MyBase.RaisePostBackEvent(source, eventArgument) 
    If source = Button2 Then 
        Dim result As String = eventArgument.ToString() 
            ' eventArgument represents the Typed text  
        Response.Write(eventArgument.ToString()) 
    End If 
End Sub 
Protected Sub Button1_Click(ByVal sender As ObjectByVal e As EventArgs) 
    ScriptManager.RegisterStartupScript(MeMe.[GetType](), "prompt""<script type='text/javascript'> Sys.Application.add_load(function(){radprompt('Reason for deleting:', promptCallBackFn, 330, 100, null,'Deep Thought', 'Type reason here...')})</script>"False
End Sub 

-Shinu.
0
Luis
Top achievements
Rank 1
answered on 11 Dec 2009, 08:08 PM
when i try to execute the vb code behind this part
"If source = Button2 Then "
gave me this error
Operator '=' is not defined for types 'System.Web.UI.IPostBackEventHandler' and 'System.Web.UI.WebControls.Button'.

Tags
Window
Asked by
Abdul Kadar
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Luis
Top achievements
Rank 1
Share this question
or