or
<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><telerik:RadGrid ID="RadGrid1" runat="server" PageSize="50" AllowSorting="True" AllowMultiRowSelection="True" AllowPaging="false" ShowGroupPanel="True" OnPageIndexChanged="RadGrid1_OnPageIndexChanged" AutoGenerateColumns="False" GridLines="none" OnNeedDataSource="RadGrid1_OnNeedDataSource"> <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle> <MasterTableView Width="100%" > <GroupByExpressions > <telerik:GridGroupByExpression > <SelectFields> <telerik:GridGroupByField FieldAlias="Category" FieldName="Category" /> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="Category" SortOrder="Ascending" /> </GroupByFields> </telerik:GridGroupByExpression> </GroupByExpressions> <Columns> <telerik:GridBoundColumn SortExpression="PatientName" HeaderText="PatientName" HeaderButtonType="TextButton" DataField="PatientName" Groupable="false" /> <telerik:GridBoundColumn SortExpression="Category" HeaderText="Category" HeaderButtonType="TextButton" DataField="Category" /> <telerik:GridBoundColumn SortExpression="LastTaskTime" HeaderText="LastTaskTime" HeaderButtonType="TextButton" DataField="LastTaskTime" /> <telerik:GridBoundColumn SortExpression="CaseStatus" HeaderText="CaseStatus" HeaderButtonType="TextButton" DataField="CaseStatus" /> </Columns> </MasterTableView> <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True" > <Selecting AllowRowSelect="True" ></Selecting> <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="False"></Resizing> </ClientSettings> <GroupingSettings ShowUnGroupButton="false"> </GroupingSettings></telerik:RadGrid>
<telerik:RadMenu ID="RadMenu1" runat="server" Width="960" EnableRoundedCorners="True" Skin="Metro" EnableShadows="True" ExpandAnimation-Type="OutQuad" CollapseAnimation-Type="InOutElastic" > <Items> <telerik:RadMenuItem Text="Products"> <Items> <telerik:RadMenuItem Text="V3<span class='ss'> TM</span>" Target="_blank" ImageUrl="/images/v3.png" NavigateUrl="http://<;LINK>" /> <telerik:RadMenuItem Text="EnVvy<span class='ss'> TM</span>" ImageUrl="/images/envvy.png" NavigateUrl="http://<;LINK>" /> </Items> </telerik:RadMenuItem> ... </Items> </telerik:RadMenu>