1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Page won't publish

Page won't publish

16 posts, 0 answered
  1. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    I have a wierd issue....actually 2. 

    I have a custom control that pulls information from a DB and displays a datalist inside an asp:panel.

    The control loads into the page just fine but I cannot publish the page, cancel changes, or even delete the control.

    I can however preview the page...again wierd...and the control seems to function correctly except for issue number 2 below.

    I end up having to log in again to get back to the page.  When I do the dashboard says that the page is locked. 

    This is not my first custom user control so I am a little frustrated and stuck.


    The second issue is related I think...maybe not....Inside my datalist I have an imagebutton that when clicked should hide the 1st panel with the datalist and display a second asp;panel with more details on the selected item.

    It seemslike the itemcommand is not being fired it just reloads the page.

    I will post my code in two additional posts so that you can have a good idea of what I am trying to do.
  2. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="SchoolList.ascx.cs" Inherits="Sitefinity_UserControls_SchoolList" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
      
    <p style="text-align:center;"><asp:LinkButton  ID="getSchools" runat="server" Text="All" onclick="getSchools_Click" />     |     <asp:LinkButton  ID="getElementarySchools" runat="server" Text="Elementary Schools" onclick="getSchools_Click" />     |     <asp:LinkButton  ID="getMiddleSchools" runat="server" Text="MiddleSchools" onclick="getSchools_Click" />     |     <asp:LinkButton  ID="getJRHighSchools" runat="server" Text="Junior High Schools" onclick="getSchools_Click" />     |     <asp:LinkButton  ID="getHighSchools" runat="server" Text="High Schools" onclick="getSchools_Click" /></p>
        <p> </p>
      
      
    <asp:Panel ID="ShowSchools" runat="server">
          
        <asp:DataList ID="SchoolList" runat="server" OnItemDataBound="SchoolList_ItemDataBound" EnableViewState="true">
            <ItemTemplate>
            <table cellpadding="0" cellspacing="0" style="width:726px; border:0px;" align="center">
        <tr>
            <td style="background-color:#CCC; padding-left:10px; font-weight:bold; font-size:15px; line-height:20px;" colspan="3"><asp:Label ID="lblSchoolLegalName" runat="server" Text="School Name" /></td>
        </tr>
        <tr>
            <td valign="top">
            <div style="width:235px; padding-left:10px;">
                <asp:Label ID="lblSchoolAddress" runat="server" Text="Address" />
                <br /><b>Phone: </b><asp:Label ID="lblSchoolPhone" runat="server" Text="" />
                <br /><b>Fax: </b><asp:Label ID="lblSchoolFax" runat="server" Text="" />
                <br /><asp:ImageButton ID="schMapButton" runat="server" Width="35px" CommandName="GetMap" OnCommand="ImageButton_Command" />
                <br /><a href='<%# DataBinder.Eval(Container.DataItem, "SiteURL")  %>'><asp:Image ID="Image3" ImageUrl="~/Images/Icons/Url.png" alt="School Website" runat="server" BorderWidth="0px" Width="35px" style="vertical-align:middle;" /></a>   <a href='<%# DataBinder.Eval(Container.DataItem, "SiteURL")  %>'>School Website</a>
            </div>
              
            </td>
            <td valign="top">
            <div style="width:251px;">
            <b>Principal: </b><asp:Label ID="lblSchoolPrincipal" runat="server" Text="" /><br />
            <b>Current Enrollment: </b><asp:Label ID="lblSchEnrollment" runat="server" Text="0000" /><br>
            <a href='<%# DataBinder.Eval(Container.DataItem, "ReportCard")  %>' target="blank"><asp:Image ID="Image5" ImageUrl="~/Images/Icons/ReportCard.gif" alt="School Report Card" runat="server" BorderWidth="0px" Width="35px" style="vertical-align:middle;" /></a>   <a href='<%# DataBinder.Eval(Container.DataItem, "ReportCard")  %>' target="blank">School Accountability Report Card</a></div></td>
            <td valign="top">
            <div style="width:240px;">
                <div style="margin-right:10px;" align="right">
                    <asp:ImageButton ID="SchoolLogo2" runat="server" Width="200px" Height="200px" />
                      
                </div>
            </div>
            </td>
        </tr>
          
    </table>
            <p> </p>
            <p> </p>
            </ItemTemplate>
              
        </asp:DataList>
    </asp:Panel>
      
      
    <asp:Panel ID="showSingleSchool" runat="server" Visible="false">
        <asp:DataList ID="singleSchoolData" runat="server" EnableViewState="true">
            <ItemTemplate>
            <table cellpadding="0" cellspacing="0" style="width:726px; border:0px;" align="center">
        <tr>
            <td style="background-color:#CCC; padding-left:10px; font-weight:bold; font-size:15px; line-height:20px;" colspan="3"><asp:Label ID="lblSchoolLegalName" runat="server" Text="School Name" /></td>
        </tr>
        <tr>
            <td valign="top">
              
              
            </td>
            <td valign="top">
            <iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src='<%# DataBinder.Eval(Container.DataItem, "MapURL")  %>' style="margin:10px;"></iframe>
            </td>
            <td valign="top">
            <div style="width:280px; position:relative; float:right;">
                <div style="margin-right:10px; margin-left:10px;">
                    <asp:ImageButton ID="SchoolLogo1" runat="server" Width="200px" Height="200px" />
                      
                <br />
                  
                <asp:Label ID="lblSingleSchoolAddress" runat="server" Text="Address" />
                <br /><b>Phone: </b><asp:Label ID="lblSingleSchoolPhone" runat="server" Text="" />
                <br /><b>Fax: </b><asp:Label ID="lblSingleSchoolFax" runat="server" Text="" />
                  
              
            <br />
      
            <b>Principal: </b><asp:Label ID="lblSingleSchoolPrincipal" runat="server" Text="" /><br />
            <b>Current Enrollment: </b><asp:Label ID="lblSingleSchoolEnrollment" runat="server" Text="0000" /><br>
            <a href='<%# DataBinder.Eval(Container.DataItem, "ReportCard")  %>' target="blank"><asp:Image ID="Image5" ImageUrl="~/Images/Icons/ReportCard.gif" alt="School Report Card" runat="server" BorderWidth="0px" Width="35px" style="vertical-align:middle;" /></a>   <a href='<%# DataBinder.Eval(Container.DataItem, "ReportCard")  %>' target="blank">School Accountability Report Card</a>
            <br /><a href='<%# DataBinder.Eval(Container.DataItem, "SiteURL")  %>'><asp:Image ID="Image3" ImageUrl="~/Images/Icons/Url.png" alt="School Website" runat="server" BorderWidth="0px" Width="35px" style="vertical-align:middle;" /></a>   <a href='<%# DataBinder.Eval(Container.DataItem, "SiteURL")  %>'>School Website</a>
    </div>
              
            </div>
            </td>
        </tr>
          
    </table>
            </ItemTemplate>
        </asp:DataList>
    </asp:Panel>
  3. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using LCISD.Web.Business.SitefinityTools;
    using LCISD.Web.Data.SitefinityTools;
    using System.Data;
    using Telerik;
    using Telerik.Cms;
    using Telerik.Cms.Web;
    using Telerik.Web.UI;
    using Telerik.Caching;
      
      
    public partial class Sitefinity_UserControls_SchoolList : System.Web.UI.UserControl
    {
        string schoolType;
      
      
      
      
        protected void Page_PreRender(object sender, EventArgs e)
        {
      
            if (!IsPostBack)
            {
                //List<LCISD.Web.Business.PreEnrollmentBO.DiscoveryLists.ResidesWithCodes> resCodes;
                //LCISD.Web.Data.PreEnrollmentDO.DataConn objResCodes = new LCISD.Web.Data.PreEnrollmentDO.DataConn();
                //resCodes = objResCodes.GetResidesWithCodes();
      
                //List<LCISD.Web.Business.SitefinityTools.SchoolInfoList> SchoolList;
                //LCISD.Web.Data.SitefinityTools.DataConn objSchoolList = new LCISD.Web.Data.SitefinityTools.DataConn();
                //SchoolList = objSchoolList.GetSchoolList();
      
                //schoolType = "";
      
                //createDataTable(schoolType);
      
            }
      
      
      
      
      
      
        }
      
        protected void Page_Load(object sender, EventArgs e)
        {
      
            if (!IsPostBack)
            {
      
      
            }
      
            schoolType = "";
      
            createDataTable(schoolType);
      
        }
      
        protected void createDataTable(string type)
        {
      
      
            DataTable schoolDT = new DataTable();
            LCISD.Web.Data.SitefinityTools.DataConn objSchools = new LCISD.Web.Data.SitefinityTools.DataConn();
            schoolDT = objSchools.GetSchoolList(type);
      
            SchoolList.DataSource = schoolDT;
            SchoolList.DataBind();
      
      
        }
      
        protected void SchoolList_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                SchoolList.DataKeyField = ((DataRowView)e.Item.DataItem).Row["SCHOOL_ID"].ToString();
      
                string schSchoolName = "";
                string schAddress = "";
      
                Label ctlSchoolName = (Label)e.Item.FindControl("lblSchoolLegalName");
                Label ctlSchoolAddress = (Label)e.Item.FindControl("lblSchoolAddress");
                Label ctlSchoolPhone = (Label)e.Item.FindControl("lblSchoolPhone");
                Label ctlSchoolFax = (Label)e.Item.FindControl("lblSchoolFax");
                Label ctlSchoolPrincipal = (Label)e.Item.FindControl("lblSchoolPrincipal");
                ImageButton ctlSchoolLogo = (ImageButton)e.Item.FindControl("SchoolLogo2");
                ImageButton ctlSchoolMap = (ImageButton)e.Item.FindControl("schMapButton");
                //Label ctlSchoolName = (Label)e.Item.FindControl("lblSchoolLegalName");
      
                schSchoolName = ((DataRowView)e.Item.DataItem).Row["SCHOOL_LEGAL_NAME"].ToString();
      
      
                schAddress = ((DataRowView)e.Item.DataItem).Row["ADDRESS_LINE1"].ToString();
                if (((DataRowView)e.Item.DataItem).Row["ADDRESS_LINE2"].ToString() != "")
                {
                    schAddress = schAddress + "<br />" + ((DataRowView)e.Item.DataItem).Row["ADDRESS_LINE2"].ToString();
                }
      
                schAddress = schAddress + "<br />" + ((DataRowView)e.Item.DataItem).Row["CITY"].ToString() + ", " + ((DataRowView)e.Item.DataItem).Row["STATE_CODE"].ToString() + " " + ((DataRowView)e.Item.DataItem).Row["ZIP_CODE"].ToString();
      
                if (((DataRowView)e.Item.DataItem).Row["ZIP_CODE_EXT"].ToString() != "")
                {
                    schAddress = schAddress + "-" + "<br />" + ((DataRowView)e.Item.DataItem).Row["ZIP_CODE_EXT"].ToString();
                }
      
                ctlSchoolName.Text = schSchoolName;
                ctlSchoolAddress.Text = schAddress;
                ctlSchoolPhone.Text = ((DataRowView)e.Item.DataItem).Row["PHONE_NUMBER"].ToString();
                ctlSchoolFax.Text = ((DataRowView)e.Item.DataItem).Row["FAX_NUMBER"].ToString();
      
                ctlSchoolPrincipal.Text = ((DataRowView)e.Item.DataItem).Row["PRINCIPALNAME"].ToString();
      
                if (((DataRowView)e.Item.DataItem).Row["Logo"].ToString() == "")
                {
                    ctlSchoolLogo.Visible = false;
                }
                else
                {
                    ctlSchoolLogo.ImageUrl = "~/Images/SchoolLogoThumbs/" + ((DataRowView)e.Item.DataItem).Row["Logo"].ToString();
                    ctlSchoolLogo.PostBackUrl = ((DataRowView)e.Item.DataItem).Row["SiteUrl"].ToString();
                }
      
                ctlSchoolMap.ImageUrl = "~/Images/Icons/Map.gif";
                ctlSchoolMap.CommandName = "display";
                ctlSchoolMap.CommandArgument = e.Item.ItemIndex.ToString();
            }
        }
      
      
        protected void getSchools_Click(object sender, EventArgs e)
        {
      
        }
      
        protected void ImageButton_Command(object source,  CommandEventArgs e)
        {
      
            if (e.CommandName == "GetMap")
            {
      
                ShowSchools.Visible = false;
                showSingleSchool.Visible = true;
      
      
                string SchoolIDNum = e.CommandArgument.ToString();
      
                DataTable singleSchool = new DataTable();
                LCISD.Web.Data.SitefinityTools.DataConn objSchool = new LCISD.Web.Data.SitefinityTools.DataConn();
                singleSchool = objSchool.GetSingleSchool(SchoolIDNum);
      
                singleSchoolData.DataSource = singleSchool;
                singleSchoolData.DataBind();
            }
      
        }
      
      
        protected void singleSchoolData_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
      
      
                string schSchoolName = "";
                string schAddress = "";
      
                Label ctlSingleSchoolName = (Label)e.Item.FindControl("lblSchoolLegalName");
                Label ctlSingleSchoolAddress = (Label)e.Item.FindControl("lblSingleSchoolAddress");
                Label ctlSingleSchoolPhone = (Label)e.Item.FindControl("lblSingleSchoolPhone");
                Label ctlSingleSchoolFax = (Label)e.Item.FindControl("lblSingleSchoolFax");
                Label ctlSingleSchoolPrincipal = (Label)e.Item.FindControl("lblSingleSchoolPrincipal");
                ImageButton ctlSingleSchoolLogo = (ImageButton)e.Item.FindControl("SchoolLogo1");
                //ImageButton ctlSchoolMap = (ImageButton)e.Item.FindControl("schMapButton");
                //Label ctlSchoolName = (Label)e.Item.FindControl("lblSchoolLegalName");
      
                schSchoolName = ((DataRowView)e.Item.DataItem).Row["SCHOOL_LEGAL_NAME"].ToString();
      
      
                schAddress = ((DataRowView)e.Item.DataItem).Row["ADDRESS_LINE1"].ToString();
                if (((DataRowView)e.Item.DataItem).Row["ADDRESS_LINE2"].ToString() != "")
                {
                    schAddress = schAddress + "<br />" + ((DataRowView)e.Item.DataItem).Row["ADDRESS_LINE2"].ToString();
                }
      
                schAddress = schAddress + "<br />" + ((DataRowView)e.Item.DataItem).Row["CITY"].ToString() + ", " + ((DataRowView)e.Item.DataItem).Row["STATE_CODE"].ToString() + " " + ((DataRowView)e.Item.DataItem).Row["ZIP_CODE"].ToString();
      
                if (((DataRowView)e.Item.DataItem).Row["ZIP_CODE_EXT"].ToString() != "")
                {
                    schAddress = schAddress + "-" + "<br />" + ((DataRowView)e.Item.DataItem).Row["ZIP_CODE_EXT"].ToString();
                }
      
                ctlSingleSchoolName.Text = schSchoolName;
                ctlSingleSchoolAddress.Text = schAddress;
                ctlSingleSchoolPhone.Text = ((DataRowView)e.Item.DataItem).Row["PHONE_NUMBER"].ToString();
                ctlSingleSchoolFax.Text = ((DataRowView)e.Item.DataItem).Row["FAX_NUMBER"].ToString();
      
                ctlSingleSchoolPrincipal.Text = ((DataRowView)e.Item.DataItem).Row["PRINCIPALNAME"].ToString();
      
                if (((DataRowView)e.Item.DataItem).Row["Logo"].ToString() == "")
                {
                    ctlSingleSchoolLogo.Visible = false;
                }
                else
                {
                    ctlSingleSchoolLogo.ImageUrl = "~/Images/SchoolLogoThumbs/" + ((DataRowView)e.Item.DataItem).Row["Logo"].ToString();
                    ctlSingleSchoolLogo.PostBackUrl = ((DataRowView)e.Item.DataItem).Row["SiteUrl"].ToString();
                }
      
                //ctlSchoolMap.ImageUrl = "~/Images/Icons/Map.gif";
                //ctlSchoolMap.PostBackUrl = "";
                //ctlSchoolMap.CommandName = "display";
                //ctlSchoolMap.CommandArgument = e.Item.ItemIndex.ToString();
            }
        }
    }
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Feb 2010
    Link to this post
    Hello bleutiger,

    As far as I see it you are using PostBackUrl. I suggest that you should take a look at this KB article - Sitefinity page freezes in Edit mode.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    Ok that makes sense...sort of.

    But based on that how would I get the index of the item in the datalist with out using the item_command...or imagebutton_command?
  6. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    and...do I have it redirect to itself?  If so how do I ge the second panel to display?  Won't it just reload the page from scratch?
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Feb 2010
    Link to this post
    Hello bleutiger,

    First the problem you have appears in edit mode - when you publish the page. There you are not working with any control data. You can use Response.Redirect instead of PostBackUrl as suggested in the KB. Another option is using Server.Transfer(..). The third option is checking whether you are in edit mode. If the condition is true just do not set btn.PostBackUrl

    if ( HttpContext.Current.Request.QueryString[ "cmspagemode" ] == "edit" )
        {
            // WE ARE IN EDIT MODE
        }


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    Ivan that piece of code was perfect...I can now publish my page and my control can be deleted and edited.


    Now on to my second issue.

    One of the image buttons is a map icon that when clicked should hide the first panel called "showAllSchools" and display a second panel called "ShowSingleSchool"

    Which will only display information for the selected school.

    When the map icon is clicked there doesn't seem to be an event fired.  the page just reloads from scratch.

    I have enabled viewstate for both asp:panels.

    Any help would be apreciated.
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Feb 2010
    Link to this post
    Hello bleutiger,

    Try subscribing for Command event on the server side - inside Page_Load. You can set the CommandName in the same place instead.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    sorry not meaning to be dense but what do you mean by subscribing for the Command event?

    I have added the command name and commandevent args programatically

    ctlSchoolMap.ImageUrl = "~/Images/Icons/Map.gif";
               ctlSchoolMap.CommandName = "display";
               ctlSchoolMap.CommandArgument = e.Item.ItemIndex.ToString();

    but I did that on the itemdatabound section so that it binds them when the Datalist is being built.

    Do I need to do something else?

  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Feb 2010
    Link to this post
    Hi bleutiger,

    Try using this

    imgButton.Command += new CommandEventHandler(imgButton_Command);
     ....
     
    void imgButton_Command(object sender, CommandEventArgs e)
    {
       // move your logic here
    }


    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  12. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    sorry Ivan...again not trying to be dense.

    I put the "imgButton.Command" in the page load or leave it where it is in the "Itemdatabound" method?


    Also should I add anything to the font end of the imagebutton?
  13. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    I added your code right before the code I posted above and now I get this error

    ...\NewLCISD\CustomControls\SchoolList.ascx.cs(178): error CS1518: Expected class, delegate, enum, interface, or struct
  14. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    oops...my bad.

    I accidentaly deleted something.

    Still no go though.  I am going to post my code and see if you can get a better look.


    protected void SchoolList_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                SchoolList.DataKeyField = ((DataRowView)e.Item.DataItem).Row["SCHOOL_ID"].ToString();
      
                string schSchoolName = "";
                string schAddress = "";
      
                Label ctlSchoolName = (Label)e.Item.FindControl("lblSchoolLegalName");
                Label ctlSchoolAddress = (Label)e.Item.FindControl("lblSchoolAddress");
                Label ctlSchoolPhone = (Label)e.Item.FindControl("lblSchoolPhone");
                Label ctlSchoolFax = (Label)e.Item.FindControl("lblSchoolFax");
                Label ctlSchoolPrincipal = (Label)e.Item.FindControl("lblSchoolPrincipal");
                ImageButton ctlSchoolLogo = (ImageButton)e.Item.FindControl("SchoolLogo2");
                ImageButton ctlSchoolMap = (ImageButton)e.Item.FindControl("schMapButton");
                //Label ctlSchoolName = (Label)e.Item.FindControl("lblSchoolLegalName");
      
                schSchoolName = ((DataRowView)e.Item.DataItem).Row["SCHOOL_LEGAL_NAME"].ToString();
      
      
                schAddress = ((DataRowView)e.Item.DataItem).Row["ADDRESS_LINE1"].ToString();
                if (((DataRowView)e.Item.DataItem).Row["ADDRESS_LINE2"].ToString() != "")
                {
                    schAddress = schAddress + "<br />" + ((DataRowView)e.Item.DataItem).Row["ADDRESS_LINE2"].ToString();
                }
      
                schAddress = schAddress + "<br />" + ((DataRowView)e.Item.DataItem).Row["CITY"].ToString() + ", " + ((DataRowView)e.Item.DataItem).Row["STATE_CODE"].ToString() + " " + ((DataRowView)e.Item.DataItem).Row["ZIP_CODE"].ToString();
      
                if (((DataRowView)e.Item.DataItem).Row["ZIP_CODE_EXT"].ToString() != "")
                {
                    schAddress = schAddress + "-" + "<br />" + ((DataRowView)e.Item.DataItem).Row["ZIP_CODE_EXT"].ToString();
                }
      
                ctlSchoolName.Text = schSchoolName;
                ctlSchoolAddress.Text = schAddress;
                ctlSchoolPhone.Text = ((DataRowView)e.Item.DataItem).Row["PHONE_NUMBER"].ToString();
                ctlSchoolFax.Text = ((DataRowView)e.Item.DataItem).Row["FAX_NUMBER"].ToString();
      
                ctlSchoolPrincipal.Text = ((DataRowView)e.Item.DataItem).Row["PRINCIPALNAME"].ToString();
      
                if (((DataRowView)e.Item.DataItem).Row["Logo"].ToString() == "")
                {
                    ctlSchoolLogo.Visible = false;
                }
                else
                {
                    ctlSchoolLogo.ImageUrl = "~/Images/SchoolLogoThumbs/" + ((DataRowView)e.Item.DataItem).Row["Logo"].ToString();
      
                    if (HttpContext.Current.Request.QueryString["cmspagemode"] == "edit")
                    {
                        // WE ARE IN EDIT MODE
                    }
                    else
                    {
      
                        ctlSchoolLogo.PostBackUrl = ((DataRowView)e.Item.DataItem).Row["SiteUrl"].ToString();
                    }
                }
      
                ctlSchoolMap.Command += new CommandEventHandler(ImageButton_Command);
      
      
                ctlSchoolMap.ImageUrl = "~/Images/Icons/Map.gif";
                ctlSchoolMap.CommandName = "display";
                ctlSchoolMap.CommandArgument = e.Item.ItemIndex.ToString();
      
            }
        }


    protected void ImageButton_Command(object source, CommandEventArgs e)
        {
      
            if (e.CommandName == "display")
            {
      
                ShowSchools.Visible = false;
                showSingleSchool.Visible = true;
      
      
                string SchoolIDNum = e.CommandArgument.ToString();
      
                DataTable singleSchool = new DataTable();
                LCISD.Web.Data.SitefinityTools.DataConn objSchool = new LCISD.Web.Data.SitefinityTools.DataConn();
                singleSchool = objSchool.GetSingleSchool(SchoolIDNum);
      
                singleSchoolData.DataSource = singleSchool;
                singleSchoolData.DataBind();
            }
      
        }
  15. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    Still not able to get the second asp:panel to display.

    Do I need to move this to a new post?
  16. bleutiger
    bleutiger avatar
    153 posts
    Registered:
    23 Oct 2008
    15 Feb 2010
    Link to this post
    Going to open a new post on this...
Register for webinar
16 posts, 0 answered