ketika saya melakukan klik button submit maka akan menampilkan Radwindows seperti screenshoot di bawah ini
Berikut adalah Code di .ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Default.ascx.cs" Inherits="Module.Subscribe.I.Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadWindow ID="rdwReport" runat="server" Height="250px" Width="450px" VisibleOnPageLoad="false"
Modal="true" BackColor="#DADADA" VisibleStatusbar="false" Behaviors="Close" Title="Report Data Tersimpan">
<contenttemplate>
<style type="text/css" >
.label
{
padding-left: 63px;
font-size: 30px;
}
.button
{
padding-left: 68px;
padding-right: 59px;
}
.bacghroud
{
overflow: auto;
border: 0px;
height: 211px;
width: 423px;
background-color: blanchedAlmond;
}
</style>
<script type="text/javascript">
function OnClientClick() {
var win = $find('<%=rdwReport.ClientID %>');
win.Close();
}
</script>
<table class ="bacghroud">
<tr>
<td class ="label">
<center><asp:Label ID="lblMessage1" runat="server" Text="Data Telah Tersimpan" /></center>
</td>
</tr>
<tr>
<td class ="button">
<center ><asp:Button ID="btnClose" runat="server" Text="Close" OnClientClick ="OnClientClick(this);return false;" /></center>
</td>
</tr>
</table>
</contenttemplate>
</telerik:RadWindow>
<asp:MultiView ID="multiviewLatter" runat="server">
<asp:View ID="viewlater" runat="server">
<table>
<tr>
<td>
<asp:TextBox ID="txtEmail1" runat="server" Width="400px" Height="50px" BorderColor="ActiveCaption"
ValidationGroup="Subcribe1"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="rv1" runat="server" ErrorMessage="Mohon Email di isi"
ForeColor="Red" Font-Size="12px" ControlToValidate="txtEmail1" ValidationGroup="Subcribe1"
SetFocusOnError="true"></asp:RequiredFieldValidator>
<br />
<asp:RegularExpressionValidator ID="Rgv1" runat="server" ControlToValidate="txtEmail1"
ErrorMessage="Email Yang anda Masukan Salah" Style="z-index: 101; left: 424px; position: absolute;
top: 285px" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="Subcribe1">
</asp:RegularExpressionValidator>
</td>
<td>
<asp:Button ID="btnsend1" runat="server" Text="Submit" Height="54px" Width="145px"
OnClick="btnsubmit_click1" ValidationGroup="Subcribe1" CausesValidation="true" />
</td>
<td>
<asp:HyperLink ID="linknewslatter" runat="server" Text="NewsLatter for Subscribe"
NavigateUrl="http://www.yahoo.com"></asp:HyperLink>
</td>
</tr>
</table>
</asp:View>
</asp:MultiView>
dan berikut adalah code.ascx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke.Entities.Modules;
using Telerik.Web.UI;
namespace Module.Subscribe.I
{
public partial class Default : PortalModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
multiviewLatter.SetActiveView(viewlater);
}
protected void btnsubmit_click1(object sender, EventArgs e)
{
try
{
Module.Fuel.Subscribe.I.Entitas.NewsLetter objnewslatter1 = new Module.Fuel.Subscribe.I.Entitas.NewsLetter();
objnewslatter1.Email = txtEmail1.Text.Trim();
Module.Fuel.Subscribe.I.Controler.SubscribeI ctlr = new Module.Fuel.Subscribe.I.Controler.SubscribeI();
ctlr.addNewsLatter(objnewslatter1);
rdwReport.VisibleOnPageLoad = true;
txtEmail1.Text = "";
}
catch (Exception ex)
{
}
}
}
}
Terimakasih
Tidak ada komentar:
Posting Komentar