5 Answers, 1 is accepted
0
Hello Rubihno,
To be able to help, we will need more information about your case. How do you open the RadWIndow and what is your exact setup?
Sincerely yours,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
To be able to help, we will need more information about your case. How do you open the RadWIndow and what is your exact setup?
Sincerely yours,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Rubihno
Top achievements
Rank 1
answered on 10 Sep 2008, 03:45 PM
I use this when i make a login, if the value are incorrect run a radwindows message
Code
Login.aspx
Login.aspx.vb
Thanks
Code
Login.aspx
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="Login" title="Untitled Page" %> |
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
<asp:Content ID="Content1" ContentPlaceHolderID="plcTitle" Runat="Server"> |
Pagina di autenticazione |
</asp:Content> |
<asp:Content ID="Content2" ContentPlaceHolderID="plcMainContent" Runat="Server"> |
<div id="PannelloLogin" runat="server"> |
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"> |
</telerik:RadWindowManager> |
<script type="text/javascript"> |
//<![CDATA[ |
function confirmCallBackFn(arg) |
{ |
alert("Confirm returned the following result: " + arg); |
} |
function promptCallBackFn(arg) |
{ |
alert ("Prompt returned the following result: " + arg); |
} |
//]]> |
</script> |
<div id="ContenitoreLogin"> |
<div id="ContenitoreCampiLogin"> |
<table style="width: 100%"> |
<tr> |
<td style="width: 110px"> |
</td> |
<td style="width: 157px"> |
</td> |
<td> |
</td> |
</tr> |
<tr> |
<td style="width: 110px"> |
Nome utente</td> |
<td style="width: 157px"> |
<asp:TextBox ID="TxtNomeUtente" runat="server" Width="160px" |
EnableViewState="False" EnableTheming="False" |
></asp:TextBox> |
</td> |
<td> |
<asp:RequiredFieldValidator ID="RFNomeUtente" runat="server" |
ControlToValidate="TxtNomeUtente" |
ErrorMessage="Devi inserire il nome utente" ValidationGroup="validazioneLogin" |
>!</asp:RequiredFieldValidator> |
</td> |
</tr> |
<tr> |
<td style="width: 110px"> |
</td> |
<td style="width: 157px"> |
</td> |
<td> |
</td> |
</tr> |
<tr> |
<td style="width: 110px"> |
NetID</td> |
<td style="width: 157px"> |
<asp:TextBox ID="TxtNetID" runat="server" Width="160px" |
TextMode="Password"></asp:TextBox> |
</td> |
<td> |
<asp:RequiredFieldValidator ID="RFNetID" runat="server" |
ControlToValidate="TxtNetID" ErrorMessage="Devi inserire il NetID" ValidationGroup="validazioneLogin" |
>!</asp:RequiredFieldValidator> |
</td> |
</tr> |
<tr> |
<td style="width: 110px"> |
</td> |
<td style="width: 157px"> |
</td> |
<td> |
</td> |
</tr> |
<tr> |
<td style="width: 110px; height: 23px;"> |
</td> |
<td style="width: 157px; height: 23px;"> |
<asp:Button ID="BtVerifica" runat="server" Text="Accedi" Width="80px" |
OnClick="BtVerifica_Click" ValidationGroup="validazioneLogin" /> |
</td> |
<td style="height: 23px"> |
</td> |
</tr> |
</table> |
<table> |
<tr> |
<td style="width: 337px"> |
</td> |
</tr> |
</table> |
<asp:Label ID="LbStato" runat="server" Text="LbStato" ForeColor="Red" |
Visible="False"></asp:Label> |
</div> |
<asp:ValidationSummary id="ValidationSummary1" runat="server" |
ShowMessageBox="True" ShowSummary="False" ValidationGroup="validazioneLogin" /> |
</div> |
</div> |
</asp:Content> |
Login.aspx.vb
Imports System.Data |
Imports System.Data.SqlClient |
Imports System.Web.UI.Control |
Imports Telerik.Web.UI |
Partial Class Login |
Inherits System.Web.UI.Page |
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load |
End Sub |
Protected Sub BtVerifica_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtVerifica.Click |
'codice per veficare i dati immessi |
Dim dbconn As SqlConnection |
dbconn = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\gestione_aule.mdf;Integrated Security=True;User Instance=True") |
Dim sqlquery As String |
sqlquery = "select * from Utenti where Nome = '" & TxtNomeUtente.Text & "' and ID_Net = '" & TxtNetID.Text & "'" |
Dim test As New SqlDataAdapter(sqlquery, dbconn) |
Dim righe = New DataTable |
test.Fill(righe) |
If righe.Rows.Count > 0 Then |
Session("NomeUtente") = TxtNomeUtente.Text |
Session("NetID") = TxtNetID.Text |
Response.Redirect("Home.aspx") |
Else |
'Me.RegisterClientScriptBlock("alertMsg", "<script>alert('Nome utente e netid errati, riprovare!');</script>") |
Dim radalertscript As String = "<script language='javascript'> window.onload = function(){radalert('Nome utente e NetID errati<br><br>Riprovare!', 330, 210);}</script>" |
Page.ClientScript.RegisterStartupScript(Me.[GetType](), "radalert", radalertscript) |
End If |
End Sub |
End Class |
Thanks
0
Hi Rubihno,
You are working in an ASP.NET AJAX environment and in AJAX, all ASP.NET AJAX controls, including RadControls are created after the page is loaded - you can check that by examining the HTML dump.
What happens is that when you try to execute the script on page's load, RadWindowManager will still not be rendered on the page which will cause the error.
To avoid the problem, you should call the script on a later stage - in MS AJAX's Sys.Application.Load.
All the best,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
You are working in an ASP.NET AJAX environment and in AJAX, all ASP.NET AJAX controls, including RadControls are created after the page is loaded - you can check that by examining the HTML dump.
What happens is that when you try to execute the script on page's load, RadWindowManager will still not be rendered on the page which will cause the error.
To avoid the problem, you should call the script on a later stage - in MS AJAX's Sys.Application.Load.
All the best,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Rubihno
Top achievements
Rank 1
answered on 15 Sep 2008, 04:09 PM
Thanks, but what i should modify to resolve a problem?...is not own clear..why in mozilla run but in explorer yes...
0

Rubihno
Top achievements
Rank 1
answered on 15 Sep 2008, 05:39 PM
Now run, i have use this code ->
RadAjaxManager1.ResponseScripts.Add("Sys.Application.add_load(function()" & Chr(13) & "" & Chr(10) & " {radalert('Welcome to RadWindow <b>Prometheus</b>!', 330, 210);})")
Hi
RadAjaxManager1.ResponseScripts.Add("Sys.Application.add_load(function()" & Chr(13) & "" & Chr(10) & " {radalert('Welcome to RadWindow <b>Prometheus</b>!', 330, 210);})")
Hi