Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0AJAX RC / Custom Module Issues.AJAX RC / Custom Module Issues.
Previous
 
Next
New Post
1/22/2007 3:07 PM
 
Ok guys, here a new one for me.

I created a web page outside of DNN leveraging some basic AJAX RC functionality (UpdatePanel with a trigger for a drop down box).  The webpage works great.

I modded a skin to add the scriptmanager, and modded a containter to add an updatepanel and a contenttemplate.  Then have my Updatepanel and contenttemplate on the module I created from the basic webpage (copy and paste into the ASCX for the most part).  When I run the module in debug mode, the page will start to load, but when it gets to using a webcontrol, it throws a NullReferenceException.

Any ideas?

<code>
<!-- .ascx code -->
<asp:UpdatePanel ID="up3" runat="server">
    <ContentTemplate>
        <asp:Timer ID="tm1" runat="server" Interval="10000" Enabled="false" />
          <div style="background-color:White">
                <asp:DropDownList ID="ddl" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddl_change">
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                Last Refresh:&nbsp;&nbsp;
                <asp:Label ID="lblTime" runat="server" />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button runat="server" ID="btnRefresh" OnClick="btn_click" Text="Refresh!!" />
            </div>
            <div style="background-color:White">
                <asp:GridView ID="gv" runat="server" AutoGenerateColumns="True" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" Font-Bold="True" Font-Names="Arial" Font-Size="Small" OnDataBound="CheckNumbers">
                    <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                    <RowStyle BackColor="#EEEEEE" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                    <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="Gainsboro" HorizontalAlign="Center"/>
                </asp:GridView>
            </div>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="ddl" EventName="SelectedIndexChanged" />
    </Triggers>
</asp:UpdatePanel>


<!-- Code-Behind-->
protected void Page_Load(object sender, EventArgs e)
        {
             pwd = new Password();
            string sqlconn = "Server=LBMSSQLT1\\sql2k5;Database=FSS;User Id=FSSAdmin;Password=" + pwd.Decrypt("WCAgCPig0csKp6MW6bmpOLOWmcqh/32gqbEkHVt/ORg=", "itsasecret");
            conn = new SqlConnection(sqlconn);
            if (!IsPostBack)
            {
                LoadDates();
            }
        }
 protected void LoadDates()
        {
            string sql = "SELECT AsOfDate FROM MON_RoutingCycleSession GROUP BY AsOfDate ORDER BY AsOfDate DESC";
            SqlDataAdapter da = new SqlDataAdapter(sql, conn);
            DataSet ds = new DataSet();
            da.Fill(ds);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (!ddl.Items.Contains(new ListItem(dr["AsOfDate"].ToString()))) <<< THROWS EXCEPTION
                {
                    ddl.Items.Add(new ListItem(dr["AsOfDate"].ToString()));
                }
            }
        }
</code>
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0AJAX RC / Custom Module Issues.AJAX RC / Custom Module Issues.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out