4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 08 Oct 2012, 05:13 AM
Hi Michael,
I suppose you want to create a login form inside the RadWindow. You can use the following approaches.
1)One suggestion is that you can add the login controls inside the ContentTemplate of the RadWindow as follows.
ASPX:
C#:
2)Another approach is that you can add the controls inside another aspx page as shown in this code library.
Hope this helps.
Regards,
Shinu.
I suppose you want to create a login form inside the RadWindow. You can use the following approaches.
1)One suggestion is that you can add the login controls inside the ContentTemplate of the RadWindow as follows.
ASPX:
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
>
<
Windows
>
<
telerik:RadWindow
ReloadOnShow
=
"true"
ID
=
"LoginWindow"
runat
=
"server"
>
<
ContentTemplate
>
User:
<
asp:TextBox
ID
=
"TextBox2"
runat
=
"server"
AutoCompleteType
=
"Disabled"
></
asp:TextBox
><
br
/>
Password: <
asp:TextBox
ID
=
"TextBox1"
runat
=
"server"
TextMode
=
"Password"
></
asp:TextBox
><
br
/>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
OnClick
=
"Button1_Click"
Text
=
"Check"
/><
br
/>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
></
asp:Label
>
</
ContentTemplate
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
C#:
protected
void
Button1_Click(
object
sender, EventArgs e)
{
if
(TextBox1.Text ==
"admin"
&& TextBox2.Text ==
"admin"
)
{
Response.Write(
"Login successful"
);
Label1.Text =
"<script type='text/javascript'>top.location.href='http://google.com';GetRadWindow().Close();</script>"
;
}
else
{
Response.Write(
"Invalid login credentials"
);
}
}
2)Another approach is that you can add the controls inside another aspx page as shown in this code library.
Hope this helps.
Regards,
Shinu.
0
Michael
Top achievements
Rank 1
answered on 11 Oct 2012, 10:42 AM
I started by using a loginview inside user control. Added a link button, radwindow. Inside the radwindow I added a asp login. The link button onclick handler loginpopup.visibleonpageload=true. This reloads the page then shows the radwindow. Is there another way to load the radwindow without reloading the page?
0
Princy
Top achievements
Rank 2
answered on 11 Oct 2012, 11:26 AM
Hi Michael,
The VisibleOnPageLoad property should not be used for this purpose. It is a behavior property which will result in the RadWindow opening every time the page is post back. Following is the sample code that I tried to open a RadWindow on click of a LinkButton.
ASPX:
C#:
Please take a look into this documentation for more information.
Regards,
Princy.
The VisibleOnPageLoad property should not be used for this purpose. It is a behavior property which will result in the RadWindow opening every time the page is post back. Following is the sample code that I tried to open a RadWindow on click of a LinkButton.
ASPX:
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"RadWindow1"
runat
=
"server"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
<
asp:LinkButton
ID
=
"LinkButton1"
runat
=
"server"
Text
=
"LinkButton1"
OnClick
=
"LinkButton1_Click"
></
asp:LinkButton
>
C#:
protected
void
LinkButton1_Click(
object
sender, EventArgs e)
{
string
scriptstring =
"<script language='javascript'>function f(){var oWnd = radopen('', 'RadWindow1');}; Sys.Application.add_load(f);</script>"
;
Page.ClientScript.RegisterStartupScript(
this
.GetType(),
"radalert"
, scriptstring);
}
Please take a look into this documentation for more information.
Regards,
Princy.
0
rdmptn
Top achievements
Rank 1
answered on 11 Oct 2012, 01:14 PM
Or just use the OnClientClick property of the button and prevent the postback
<asp:LinkButton runat="server" ID="LinkButton1" OnClientClick="openRw(); return false;"></asp:LinkButton>
<asp:LinkButton runat="server" ID="LinkButton1" OnClientClick="openRw(); return false;"></asp:LinkButton>
function openRw(){
$find("<Your RadWindow's ClientID>").show();
}