8 Replies - 1703 Views - Last Post: 15 November 2013 - 10:13 AM Rate Topic: -----

#1 parkour86  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 32
  • Joined: 26-January 09

Help removing the limit from the database output

Posted 13 November 2013 - 09:05 PM

I currently run a website that uses aspx and I have no experience in coding in that language. My brother bought the site www.jackpotbuddy.com and he thought I could program in aspx but i'm only able to program in php.

The problem i'm having is that on the dashboard of my website it shows only 8 of the most recent lottery pools from the database. What I want it to do is to only show all the active lottery pools in the database. I have searched the code for everything that shows an 8 but am unable to find it. I can give you ftp access so that you can see the code.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Help removing the limit from the database output

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9572
  • View blog
  • Posts: 36,244
  • Joined: 12-June 08

Re: Help removing the limit from the database output

Posted 13 November 2013 - 09:33 PM

You would need to be more specific regarding the code you wrote.... I mean you wrote this dashboard, right?
Was This Post Helpful? 0
  • +
  • -

#3 parkour86  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 32
  • Joined: 26-January 09

Re: Help removing the limit from the database output

Posted 14 November 2013 - 12:06 PM

View Postmodi123_1, on 13 November 2013 - 09:33 PM, said:

You would need to be more specific regarding the code you wrote.... I mean you wrote this dashboard, right?


No my brother bought the site from someone else. If you head to jackpotbuddy.com and on that main page it shows 3 lottery pools but I am unsure of how to change the limit for that and the one on the dashboard page. In php I would just add the limit option to the SQL query to limit what I want but I have no clue how ASPX does it since I can't find any SQL statements in the code.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9572
  • View blog
  • Posts: 36,244
  • Joined: 12-June 08

Re: Help removing the limit from the database output

Posted 14 November 2013 - 12:26 PM

... did this person give you the ASP.NET solution, or just what ever files were found there?

If it is the latter then you may be SOL. ASP.NET compiles their server side code into a bin folder.. you cannot modify the files in the 'bin' unless you have the solution.
Was This Post Helpful? 0
  • +
  • -

#5 parkour86  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 32
  • Joined: 26-January 09

Re: Help removing the limit from the database output

Posted 14 November 2013 - 04:59 PM

View Postmodi123_1, on 14 November 2013 - 12:26 PM, said:

... did this person give you the ASP.NET solution, or just what ever files were found there?

If it is the latter then you may be SOL. ASP.NET compiles their server side code into a bin folder.. you cannot modify the files in the 'bin' unless you have the solution.


Yeah, we have the solution file. If you would like I can give you remote access to my desktop and you could show me how to navigate the code and maybe help me solve this simple solution. I have visual studio installed and ready to go with the code already loaded. I fully understand PHP but ASP.NET is something new to me. I find it weird that we have to compile the code for a website.
Was This Post Helpful? 0
  • +
  • -

#6 astonecipher  Icon User is offline

  • D.I.C.
  • member icon

Reputation: 795
  • View blog
  • Posts: 3,479
  • Joined: 03-December 12

Re: Help removing the limit from the database output

Posted 14 November 2013 - 07:45 PM

Look in the code behind files for SQL or linQ statements to change the limits.
Was This Post Helpful? 0
  • +
  • -

#7 parkour86  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 32
  • Joined: 26-January 09

Re: Help removing the limit from the database output

Posted 14 November 2013 - 11:35 PM

View Postastonecipher, on 14 November 2013 - 07:45 PM, said:

Look in the code behind files for SQL or linQ statements to change the limits.


I went through and did a search for SQL, linQ and limit which none of them had anything to do with limiting the output. Maybe this will help. This is the dashboard page that shows the 8 lottery pools.

<%@ Page Title="" Language="C#" MasterPageFile="~/App_Master/Member.Master" AutoEventWireup="true" CodeFile="joingroup.aspx.cs" Inherits="Users_joingroup" %>

<%@ Register Src="../wu-controls/usersidebar.ascx"      TagName="usersidebar"       TagPrefix="uc1" %>
<%@ Register Src="../wu-controls/freeusersidebar.ascx"  TagName="freeusersidebar"   TagPrefix="uc2" %>
<%@ Register Src="../wu-controls/ucticketlisting.ascx"  TagName="ucticketlisting"   TagPrefix="uc3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="/countdown/jquery.countdown.css" />
 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="content">
        <div class="wide long">
            <div id="membership_slider_container" class="txt left">
                <uc1:usersidebar ID="usersidebar1" runat="server" />
                <uc2:freeusersidebar ID="usersidebar2" runat="server" />
            </div>
            <div id="inner-right-content" class="left mt15" style="border-left: 1px dotted rgb(206, 206, 206);">
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="700">
                    <tbody>
                        <tr>
                            <td colspan="3" valign="top">
                                <p style="margin-top: -20px;">
                                </p>
                                <table align="center" border="0">
                                    <tbody>
                                        <tr>
                                            <td height="140" width="210">
                                                <uc3:ucticketlisting ID="ucticketlisting1" runat="server" />
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <br />
                                <p>
                                </p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="wide">
                <div class="bottom">
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript"  src="/countdown/jquery.countdown.js" ></script>
    <script language="javascript" type="text/javascript">
        function MM_swapImgRestore(obj, loc) { $('#' + obj).attr('src', loc); }

        function MM_swapImage(obj, loc) { $('#' + obj).attr('src', loc); }
        $(document).ready(function () {
            $(document).ready(function () {
                var count = $('#totalCount').val();
                if (count > 0) {
                    for (var i = 1; i <= count; i++) {
                        $('#countdown' + i).countdown({
                            timestamp: $('#hdncountdown' + i).val(),
                            callback: function (days, hours, minutes, seconds) {
                                if (days == 10 && hours == 04 & minutes == 15 & seconds == 50) {
                                }
                            }
                        });
                    }
                }
            });

            $('#fancybox-close').click(function () {
                document.location.href = "joingroup.aspx";
            });

        });


        $('.nav a').removeClass('active');
        $('#lnkDashboard').addClass('active');

        $('.user-nav a').removeClass('active');
        $('#lnkJoinGroupFree').addClass('active');
    </script>
</asp:Content>



Was This Post Helpful? 0
  • +
  • -

#8 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 446
  • View blog
  • Posts: 1,501
  • Joined: 28-April 09

Re: Help removing the limit from the database output

Posted 15 November 2013 - 06:16 AM

You probably need to look in "../wu-controls/ucticketlisting.ascx" or it's .cs file. That's a user control and looks like it contains the actual code for that page. OR post the code from it here so we can look at it.
Was This Post Helpful? 0
  • +
  • -

#9 parkour86  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 32
  • Joined: 26-January 09

Re: Help removing the limit from the database output

Posted 15 November 2013 - 10:13 AM

View PostNakor, on 15 November 2013 - 06:16 AM, said:

You probably need to look in "../wu-controls/ucticketlisting.ascx" or it's .cs file. That's a user control and looks like it contains the actual code for that page. OR post the code from it here so we can look at it.


Here are the two files.

Filename: ucticketlisting.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucticketlisting.ascx.cs"
    Inherits="jackpotBuddy.wu_controls.ucticketlisting" %>
<div class="join-group-listing">
    <asp:Repeater ID="rptTicketList" runat="server" OnItemDataBound="rptTicketList_ItemDataBound">
        <HeaderTemplate>
            <div class="listing">
                <ul>
        </HeaderTemplate>
        <ItemTemplate>
            <li>
                <div class="list-logo">
                  <br/>
                 <!--  <a target="_blank" href="<%# DataBinder.Eval(Container.DataItem, "LotteryUrl")%>"> -->

                        <asp:Image Width="151" ID="imgGroupImage" runat="server" Height="99" />

                 <!--   </a> -->
                </div>

                <div class="lottery-desc">
                    <div class="price">
                        Jackpot: $
                        <asp:Label runat="server" ID="lblPrice"></asp:Label>
                    </div>
                    <div class="draw">
                        Draw Date:
                        <asp:Label runat="server" ID="lblDrawDate"></asp:Label>
                    </div>
                    
                </div>
                <div class="links">
                    <div class="time">
                        Time remaining <span>
                            <asp:Label runat="server" ID="lblTimeRemain"></asp:Label>
                        </span>
                    </div>
                    <asp:Literal runat="server" ID="ltPlayNow"></asp:Literal>
                    <div class="clear">
                    </div>
                    <span class="verdana11"><span class="verdana11">Days &nbsp;&nbsp;:&nbsp;&nbsp; Hours
                        &nbsp;&nbsp;:&nbsp;&nbsp; Minutes &nbsp;&nbsp;:&nbsp;&nbsp; Seconds<span class="verdana11"></span></span></span>
                </div>
            </li>
        </ItemTemplate>
        <FooterTemplate>
            </ul> </div>
        </FooterTemplate>
    </asp:Repeater>
</div>
<input type="hidden" id="totalCount" value="<%=count-1%>" />



Filename: ucticketlisting.ascx.cs
//--------------------------------------------------------------------------
// <copyright file="ucticketlisting.ascx.cs" company="Diglig, Inc.">
//     Copyright (c) a Diglig, Inc. All rights reserved.
//
//     Reproduction or transmission in whole or in part, in 
//     any form or by any means, electronic, mechanical, or otherwise, is 
//     prohibited without the prior written consent of the copyright owner.
// </copyright>
// <author>a</author>
//--------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

using jackpotBuddy.dal;

namespace jackpotBuddy.wu_controls
{
    public partial class ucticketlisting : UserControl
    {
        #region Constants and Fields

        public int count = 1;

        public string drawdate = string.Empty;

        #endregion

        #region Public Methods and Operators

        public void GetTickets()
        {
            try
            {
                MembershipUser currentUser = Membership.GetUser();
                if (currentUser != null && !this.Request.Url.AbsolutePath.Contains("index.aspx"))
                {
                    SqlDataReader dr = JackpotBuddyDAL.GetGroupTicketforUser(currentUser.ProviderUserKey.ToString());
                    if (dr.HasRows)
                    {
                        this.rptTicketList.DataSource = dr;
                        this.rptTicketList.DataBind();
                    }
                }
                else
                {
                    SqlDataReader drHome = JackpotBuddyDAL.GetTicketforHome();
                    if (drHome.HasRows)
                    {
                        this.rptTicketList.DataSource = drHome;
                        this.rptTicketList.DataBind();
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }

        #endregion

        #region Methods

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsCallback)
            {
                this.GetTickets();
            }
        }

        protected void rptTicketList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string strImgUrl;

                // Bind group image
                if (!string.IsNullOrEmpty(DataBinder.Eval(e.Item.DataItem, "GroupImage").ToString()))
                {
                    strImgUrl = ConfigurationManager.AppSettings["lotteryImagePath"] + DataBinder.Eval(e.Item.DataItem, "GroupImage");
                }
                else
                {
                    strImgUrl = "../img/logo.jpg";
                }

                ((Image)e.Item.FindControl("imgGroupImage")).ImageUrl = strImgUrl;

                // Bind ticket details
                ((Label)e.Item.FindControl("lblPrice")).Text =
                    Math.Round(Convert.ToDecimal(DataBinder.Eval(e.Item.DataItem, "JackpotPrice")), 1).ToString("##,###,###");
                ((Label)e.Item.FindControl("lblDrawDate")).Text =
                    Convert.ToDateTime(DataBinder.Eval(e.Item.DataItem, "DrawDate")).ToString("MMM d yyyy");
                //((HyperLink)e.Item.FindControl("hrefMoreInfo")).NavigateUrl = "/users/more_info.aspx?pool_id="
                //                                                              + DataBinder.Eval(e.Item.DataItem, "TicketId");
                string moreInfoUrl = @"/users/more_info.aspx?pool_id=" + DataBinder.Eval(e.Item.DataItem, "TicketId");

                // Bind play now button
                string strPlyButton = string.Empty;

                strPlyButton = string.Format("<a class=\"orangeBtn btn-play-home\" id=\"ahrefPlayNow\" href=\"{0}\">More Details</a>", moreInfoUrl);
                this.drawdate = Utility.Utility.GetPoolCloseTime(Convert.ToDateTime(DataBinder.Eval(e.Item.DataItem, "DrawDate")));

                // Play now button and ticket counter part
                string strTicketCounter = "<div id=\"countdown" + this.count + "\"></div><input type=\"hidden\" id=\"hdncountdown" + this.count
                                          + "\" value=\"" + this.drawdate + "\"/>";
                ((Literal)e.Item.FindControl("ltPlayNow")).Text = strPlyButton + strTicketCounter;
                this.count++;
            }
        }

        #endregion
    }
}


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1