i have a simple form which is used to login the user to the web application i develop,
i want to show messages to users in case their username and password are incorrect.
i want to use the radWindow control.
i put the following code on my login button click event
.....
......
after user name and paswword validating
if(false){
Telerik.Web.UI.
RadWindow newWindow = new Telerik.Web.UI.RadWindow
();
newWindow.NavigateUrl =
"My Message Form name"
;
newWindow.OpenerElementID = btnLogin.ClientID;
newWindow.VisibleOnPageLoad =
true
;
newWindow.DestroyOnClose =
true
;
RadWindowManager1.Windows.Add(newWindow);
}
this works fine when click the button by the user...
but if the page is reloaded/refreshed the window is opened again and again...
i don't wont this to happen..
how to prevent the rad window to show if the page is refreshed?
Hope you can help me....
Thanks
Best Regards
6 Answers, 1 is accepted
Hi Asa'ad,
When a RadWindow is declared in RadWindowManager it preserves its ViewState which may lead to this unexpected result when the VisibleOnPageLoad property is used with the idea to show the RadWindow only once. Possible solutions for this case are the following ones:
- Set EnableViewState = "false" for the RadWindowManager
- Reset the VisibleOnPageLoad property to false with code when suitable, depending on the particular scenario
- Show the RadWindow through registering a script from the server instead (see the this blog post for more information on the matter).
Regards,
Marin
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

i tried to call the window or alert from code behind using the RadAjaxManager as the following example and it worked for me very well...
protected void btnOk_Click(object sender, EventArgs e)
{
RadAjaxManager1.ResponseScripts.Add(
@"radalert('Welcome to RadWindow <b>Prometheus</b>!', 330, 210);");
}
thank you again...

[WindowName].Windows.Clear(); in the pageload.
Seemed to work, which I thought was a little strange. I was anticipating that I would need to include a trap in the pageload function so that when the button was clicked the [WindowName].Windows.Clear(); line would be bypassed. For some reason my code works without the trap
Phil

Is there any other way to display an alert box using relerik controls from code behind in asp.net??
If yes, please help me out.
Thanks,
Santhosh Kumar Gudise

Try the following code snippet to open an alert box on button click.
CS:
protected
void
Button1_Click(
object
sender, EventArgs e)
{
RadWindowManager windowManager = FindControl(
this
,
"WindowManager"
)
as
RadWindowManager;
windowManager.RadAlert(
"MessageText"
, 400,
null
,
"title"
,
null
);
}
Thanks,
Princy.

Here is an easy way to implement alert, prompt,confirm boxes.
I'm displaying the radAlert box from code behind by using below code and it is working fine for me and easy to implement.
In aspx,
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" />
<asp:Button ID="btnRadAlert1" Text="Show Alert" runat="server" OnClick="btnRadAlert1_Click" />
In aspx.cs:
protected void btnRadAlert1_Click(object sender, EventArgs e)
{
RadWindowManager1.RadAlert("Successfully created", 200, 100, "Message", null);
//Like wise u can display confirm, prompt boxes also.
}
Hope it might be useful for anyone..!!
Thanks n Regards,
Santhosh Kumar Gudise