or
var w = radopen('dialogpage.aspx', null);
w.maximize();
w.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
w.maximize();
w.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
function GetRadWindow() { var oWindow = null; if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well) return oWindow; }; function CloseAndRebind() { GetRadWindow().Close(); GetRadWindow().BrowserWindow.UpdateFromPopup('information being passed back'); };
<telerik:RadGrid ID="rgSecurity" runat="server" AllowPaging="true" AllowMultiRowSelection="True" GridLines="None" AllowSorting="true" Width="99%"> <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" /> <ItemStyle Wrap="false" /> <HeaderStyle Wrap="false" /> <ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" AllowColumnHide="true" Resizing-AllowColumnResize="true" Resizing-EnableRealTimeResize="true" ReorderColumnsOnClient="true"> <Resizing ResizeGridOnColumnResize="true" ClipCellContentOnResize="false" /> <DataBinding Location="~/ReportManagement/ReportDesigner.aspx" SelectMethod="wmBindSecurity" /> <Selecting AllowRowSelect="true" /> <ClientEvents OnRowSelected="RowSelected" OnRowDeselected="RowSelected" OnDataBindingFailed="rgSecurity_OnDataBindingFailed"> </ClientEvents> </ClientSettings> <MasterTableView AutoGenerateColumns="false" AllowNaturalSort="false" ClientDataKeyNames="Id" CommandItemDisplay="Top"> <CommandItemTemplate> <telerik:RadToolBar ID="rtbSecurity" runat="server" Height="26px" Width="100%" ClientIDMode="Static" OnClientButtonClicking="rtbSecurity_onToolBarClientButtonClicking"> <Items> <telerik:RadToolBarButton Text="Add" ImageUrl="~/Images/NewEnable2.png" runat="server" ClientIDMode="Static" Value="Add" CommandName="Add" CssClass="RadToolBar"> </telerik:RadToolBarButton> <telerik:RadToolBarButton Text="Remove" ImageUrl="~/Images/imgDelBtnEnable.png" runat="server" ClientIDMode="Static" Value="Delete" CommandName="Delete" CssClass="RadToolBar" Enabled="false"> </telerik:RadToolBarButton> </Items> </telerik:RadToolBar> </CommandItemTemplate> <Columns> <telerik:GridClientSelectColumn UniqueName="column" HeaderStyle-Width="35px" ItemStyle-Width="35px" Resizable="false"> </telerik:GridClientSelectColumn> <telerik:GridTemplateColumn UniqueName="Name" HeaderText="Name" SortExpression="Name" ShowSortIcon="true" ItemStyle-Wrap="false"> <ClientItemTemplate> <label id="aName_#=Id#" border="0" #=Type == 0 ? "style='background: url(../Images/usersetting.png) top left no-repeat !important;padding-left:18px'" : "style='background: url(../Images/user-groups.png) top left no-repeat !important;padding-left:18px'"#>#=Name#</label> </ClientItemTemplate> <ItemStyle Wrap="false" /> <HeaderStyle Wrap="false" /> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="AllowRead" HeaderText="Read" SortExpression="AllowRead" ShowSortIcon="true" HeaderStyle-Width="10%" ItemStyle-Width="10%"> <ClientItemTemplate> <input type="checkbox" id="chk_read_#=Id#" #=AllowRead == true ? "checked" : "" # #=AllowWrite == true ? "disabled" : "" # onclick="javascript:OnChangeSecurity('#=Id#','#=Type#')"/> </ClientItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="AllowWrite" HeaderText="Write" SortExpression="AllowWrite" ShowSortIcon="true" HeaderStyle-Width="15%" ItemStyle-Width="15%"> <ClientItemTemplate> <input type="checkbox" id="chk_write_#=Id#" #=AllowWrite == true ? "checked" : "" # onclick="javascript:OnChangeSecurity('#=Id#','#=Type#')"/> </ClientItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid>[WebMethod] public static Dictionary<string, object> wmBindSecurity(int startRowIndex, int maximumRows, List<GridSortExpression> sortExpression, List<GridFilterExpression> filterExpression) { if (HttpContext.Current.Session["UserName"] == null) throw new Exception("SESSION_TIMEOUT"); Dictionary<string, object> data = new Dictionary<string, object>(); if (HttpContext.Current.Session["AnalystFile"] == null) throw new Exception("SESSION_TIMEOUT"); List<SQCUser> allUsers = SQCUserList.GetUserList(); List<SQCUserGroup> allGroups = SQCUserGroupList.GetGroupList(); List<SQCUserGroupResourceMapping> lstUserGroupResourceMapping = ((SQWAnalystFile)HttpContext.Current.Session["AnalystFile"]).UserGroupReportMapping; List<SQCUserResourceMapping> lstUserResourceMapping = ((SQWAnalystFile)HttpContext.Current.Session["AnalystFile"]).UserReportMapping; List<SQCUser> oUsers = SQCUserList.GetUserList(); var oData = lstUserGroupResourceMapping.Select(o => new { Id = o.GroupId, Name = allGroups.Find(g => g.GroupId == o.GroupId).GroupName, Type = "User Group", AllowRead = o.AllowRead, AllowWrite = o.AllowWrite }).ToList(); oData.AddRange(lstUserResourceMapping.Select(p => new { Id = p.UserId, Name = SQCUserList.GetUserByUserID(p.UserId).UserName, Type = "User", AllowRead = p.AllowRead, AllowWrite = p.AllowWrite }).ToList()); if (oData.Count > 0) data.Add("Data", oData.Skip(startRowIndex).Take(maximumRows)); else data.Add("Data", new List<SQCUserGroupResourceMapping>()); data.Add("Count", 0); return data; }<EditItemTemplate> <telerik:RadDatePicker ID="RadDatePicker1" runat="server" ></telerik:RadDatePicker></EditItemTemplate>Data Access Layer//Getter and setter methodpublic string Url{ get { return _url; } set { _url = value; }}public string TargetAudience{ get { return _targetAudience; } set { _targetAudience = value; }}public string Image{ get { return _image; } set { _image = value; }}public string OnMouseOverText{ get { return _onMouseOverText; } set { _onMouseOverText = value; }}public int AdvertisementID{ get { return _advertisementID; } set { _advertisementID = value; }}public int Location{ get { return _location; } set { _location = value; }}//Constructor public AdvertisementDAL(){} public AdvertisementDAL(int advertisementID, int location,string image, string targetAudience,string url, string onMouseOverText){ _advertisementID = advertisementID; _location = location; _image = image; _targetAudience = targetAudience; _url = url; _onMouseOverText = onMouseOverText;} public int updateNoOfClick(DateTime now, int ID) { string sql = "Select NoOfClick From AdvertisementRecord " + "Where RecordDate = @recordDate AND FK_AdvertisementID = @aID"; SqlConnection conn = new SqlConnection(_connStr); SqlCommand cmd = new SqlCommand(sql, conn); cmd.Parameters.AddWithValue("@recordDate", now); cmd.Parameters.AddWithValue("@aID", ID); conn.Open(); int noOfClick = int.Parse(cmd.ExecuteScalar().ToString()); noOfClick++; conn.Close(); string sql1 = "Update AdvertisementRecord SET NoOfClick = @Click " + "WHERE RecordDate = @Date AND FK_ADvertisementID = @aID"; //SqlConnection conn = new SqlConnection(_connStr); SqlCommand cmd1 = new SqlCommand(sql1, conn); cmd1.Parameters.AddWithValue("@Click", noOfClick); cmd1.Parameters.AddWithValue("@aID", ID); cmd1.Parameters.AddWithValue("@Date", now); conn.Open(); int row = 0; row = cmd1.ExecuteNonQuery(); conn.Close(); return row; } public AdvertisementDAL selectAdvertisementLocation1(DateTime now, string gender) { AdvertisementDAL dal = null; string sql = "Select * From Advertisement Where @currentDate between StartDate AND EndDate AND TargetAudience = @gender AND Location = 1"; SqlConnection conn = new SqlConnection(_connStr); SqlCommand cmd = new SqlCommand(sql, conn); cmd.Parameters.AddWithValue("@currentDate", now); cmd.Parameters.AddWithValue("@gender", gender); conn.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { _advertisementID = int.Parse(dr["AdvertisementID"].ToString()); _location = int.Parse(dr["Location"].ToString()); _image = dr["Image"].ToString(); _targetAudience = dr["TargetAudience"].ToString(); _url = dr["Url"].ToString(); _onMouseOverText = dr["OnMouseOverText"].ToString(); dal = new AdvertisementDAL(_advertisementID, _location, _image, _targetAudience, _url, _onMouseOverText); } conn.Close(); dr.Close(); dr.Dispose(); return dal; }This is my business Logic Layerpublic AdvertisementDAL selectAdLocation1(DateTime now, string gender) { AdvertisementDAL dal = new AdvertisementDAL(); return dal.selectAdvertisementLocation1(now, gender); } public void InsertOrUpdateupdateNoOfClick(DateTime now, int aID) { AdvertisementDAL dal = new AdvertisementDAL(); int existDate = dal.checkRecordDateIsExist(now, aID); if (existDate == 0) { dal.insertAdvertisementRecord(now, aID); } else if (existDate > 0) { dal.updateNoOfClick(now, aID); } }
Presentation Layer.
<telerik:RadRotator ID="RadRotator1" runat="server">
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server"
Height="224px" Width="102px" />
</ItemTemplate>
</telerik:RadRotator>
I have a radrotator with a image button control. I wanted the rad rotator look similar like this
http://demos.telerik.com/aspnet-ajax/rotator/examples/bannerrotation/defaultcs.aspx
They will load a lot of advertisement images.
when a user click on the specific advertisement,
they will update the specific advertisement the no of click.
The problem is how do I do it in aspx.cs? at page_load
<GroupByExpressions> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField FieldAlias="Gmina" FieldName="NazwaOrganuProwadzacego" FormatString="{0:D}" /> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="NazwaOrganuProwadzacego" SortOrder="Ascending" /> </GroupByFields> </telerik:GridGroupByExpression> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField FieldAlias="Nazwa Placówki" FieldName="NazwaPlacowki" FormatString="{0:D}" /> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="NazwaPlacowki" SortOrder="Ascending" /> </GroupByFields> </telerik:GridGroupByExpression></GroupByExpressions>