Using an Update Panel in a Web User Control

Last post 10-17-2007 6:02 AM by Jin-Yu Yin - MSFT. 10 replies.

Sort Posts:

  • Using an Update Panel in a Web User Control

    10-15-2007, 8:44 AM
    • Participant
      1,153 point Participant
    • Dollarjunkie
    • Member since 01-28-2007, 8:18 AM
    • Posts 860

    Hi,

    I am trying to use an Update control  inside of a web user Control and I keep getting error messages that say my Datalist which I put within the update user control is not recognized. Is it that I can not use an UpdatePanel Control in a user control??

    Dollarjunkie

    .Net Web/Software Engineer
  • Re: Using an Update Panel in a Web User Control

    10-15-2007, 8:53 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hello.

    well, yes, you can  use an updatepanel inside the user control. are you getting an error or a warning in the design environmente of the VS?

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Using an Update Panel in a Web User Control

    10-15-2007, 2:54 PM
    • Participant
      1,153 point Participant
    • Dollarjunkie
    • Member since 01-28-2007, 8:18 AM
    • Posts 860

     

    Here is a sample of the sort of error message I get

     

    Error 2 Type 'System.Web.UI.UpdatePanel' does not have a public property named 'GridView'. 
    Error 3 Type 'System.Web.UI.UpdatePanel' does not have a public property named 'Columns'. 

    Error 4 Type 'System.Web.UI.UpdatePanel' does not have a public property named 'TemplateField'. 
    Error 5 Type 'System.Web.UI.UpdatePanel' does not have a public property named 'ItemTemplate'. 

     

    .Net Web/Software Engineer
  • Re: Using an Update Panel in a Web User Control

    10-15-2007, 3:30 PM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hello again.

    can you show us a snippet of the updatepanel declaration?

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Using an Update Panel in a Web User Control

    10-15-2007, 7:01 PM
    • Participant
      1,153 point Participant
    • Dollarjunkie
    • Member since 01-28-2007, 8:18 AM
    • Posts 860

    Hi,

     I compiled and it was able to recognize the DataList control but when I try to set a trigger with the lnlPrev and lnkNext Hypertext controls, they are not recognized

    <table width="285" border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td align="left" valign="middle">

    &nbsp;</td>

    <td align="left" valign="middle">

    <div id="fileList" class="fileListStyle" runat="server">

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

    <ContentTemplate>

    <asp:DataList ID="AlbumList" runat="server" RepeatColumns="3" Width="95%" OnDeleteCommand="AlbumList_DeleteCommand"

    DataKeyField="dblUploadImageId" Style="z-index: 100; left: 0px; position: absolute;

    top: 0px">

    <ItemTemplate>

    <table>

    <tr>

    <td colspan="2" align="center">

    <div style="padding-left: 1px; padding-bottom: 1px; width: 60px; cursor: hand; padding-top: 1px;

    position: relative; border-bottom: #cccccc 0px solid;" onclick="fnInsertImage( '<%#GetImageID( DataBinder.Eval(Container.DataItem, "strUploadImageName").ToString() ,DataBinder.Eval(Container.DataItem, "dblUploadImageId").ToString()) %>' ,'<%#DataBinder.Eval(Container.DataItem, "strimagesrc")%>')">

    <img alt="" id="Image1" style="left: 1px; width: 55px; height: 55px; position: relative"

    ondrag="window.event.returnValue = false;" src='<%#GetAlbumImageUrl(DataBinder.Eval(Container.DataItem, "strImageSrc").ToString())%>'

    tooltip='<%#DataBinder.Eval(Container.DataItem, "strUploadImageName")%>' runat="server" />

    </div>

    </td>

    </tr>

    <tr>

    <td style="border: 0px; padding: 0px; margin: 0px;" align="right" valign="top">

    <a runat="server" class="pbox" id="EditPhoto" href='<%# getEditLink(DataBinder.Eval(Container.DataItem, "strimagesrc").ToString(),DataBinder.Eval(Container.DataItem, "dblUploadImageId").ToString())%>'>

    <asp:Image ID="Image2" ImageUrl="~/Images/edit.gif" runat="server" />

    </a>

    </td>

    <td style="border: 0px; padding: 0px; margin: 0px;" align="left" valign="top">

    <asp:ImageButton ID="BtnDelete" runat="server" OnCommand="AlbumList_DeleteCommand"

    CommandArgument='<%# DataBinder.Eval(Container.DataItem, "dblUploadImageId")%>'

    CommandName="delete" OnClientClick="return confirm('Request that this item be deleted?');"

    ToolTip="Delete this photo." ImageUrl="~/Images/delete.gif" />

    </td>

    </tr>

    </table>

    </ItemTemplate>

    </asp:DataList>

    </ContentTemplate>

    </asp:UpdatePanel>

    </div>

    </td>

    <td align="left" valign="bottom">

    </td>

    </tr>

    <tr>

    <td>

    </td>

    <td align="center">

    &nbsp;

    <asp:HyperLink ID="lnkPrev" runat="server" CssClass="arial11N000000"><< Prev</asp:HyperLink>

    &nbsp;

    <asp:Label ID="lblCurrentPage" runat="server" CssClass="arial11N000000"></asp:Label>&nbsp;

    <asp:HyperLink ID="lnkNext" runat="server" CssClass="arial11N000000">Next >></asp:HyperLink>

    </td>

    <td>

    </td>

    </tr>

     </table>

    .Net Web/Software Engineer
  • Re: Using an Update Panel in a Web User Control

    10-16-2007, 11:14 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hello.

    hum...i'm not seeing the trigger declaration here...how are you performing that operation? can you show us how you're creating the trigger?

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Using an Update Panel in a Web User Control

    10-16-2007, 11:33 AM
    • Member
      430 point Member
    • morpheus_24
    • Member since 10-15-2007, 5:49 AM
    • Pune
    • Posts 90

    hi,

    Instead of hyperlink use link button.Because as per my knowledge trigger required event name and hyperlink does not fire any event.

    Can you share your trigger code with us. 

  • Re: Using an Update Panel in a Web User Control

    10-16-2007, 3:14 PM
    • Participant
      1,153 point Participant
    • Dollarjunkie
    • Member since 01-28-2007, 8:18 AM
    • Posts 860

    morpheus_24:

    hi,

    Instead of hyperlink use link button.Because as per my knowledge trigger required event name and hyperlink does not fire any event.

    Can you share your trigger code with us. 

     

    The HyperLinks are used for the DataList Pagination. Basically what I want to do is when the Next or Previous Links are clicked, the DataList should be updated . Are you sure using a Link Button is better than me using the HyperLinks as I already am??

     

     

    .Net Web/Software Engineer
  • Re: Using an Update Panel in a Web User Control

    10-16-2007, 3:14 PM
    • Participant
      1,153 point Participant
    • Dollarjunkie
    • Member since 01-28-2007, 8:18 AM
    • Posts 860

    morpheus_24:

    hi,

    Instead of hyperlink use link button.Because as per my knowledge trigger required event name and hyperlink does not fire any event.

    Can you share your trigger code with us. 

     

    The HyperLinks are used for the DataList Pagination. Basically what I want to do is when the Next or Previous Links are clicked, the DataList should be updated . Are you sure using a Link Button is better than me using the HyperLinks as I already am??

     

     

    .Net Web/Software Engineer
  • Re: Using an Update Panel in a Web User Control

    10-16-2007, 6:15 PM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hello.

    question: how about putting the hyperlinks inside the updatepanel?

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Using an Update Panel in a Web User Control

    10-17-2007, 6:02 AM
    Answer

    Hi, Use LinkButton rather than hyperlink!  

    ControlID Property

    Gets or sets a string that represents the ID of the control that is a trigger for the UpdatePanel control.

    The ControlID property must be set to the ID of a control that implements the INamingContainer, IPostBackDataHandler, or IPostBackEventHandler interface.

    See Also

    Best Regards,

    Sincerely,
    Jin-Yu Yin
    Microsoft Online Community Support
Page 1 of 1 (11 items)