hyperlinks breaks in updatepanel

Last post 06-30-2008 4:03 PM by krishnanellutla. 2 replies.

Sort Posts:

  • hyperlinks breaks in updatepanel

    06-30-2008, 2:57 PM

    hi Ajax  Experts,


    I have  Search form with LastName, FirstName, Department, Institution, keywor, publications, Search Button(onclick), few gridviews,
    all these controls are inside updatepanel
    issues with updatpanel

    1. whenever postback occurs hyperlinks in the gridview controls are loosing, i can only see texts with links.
    2. I am trying to enable a master page asp panel when search results comes up. but its not working, i know bcoz masterpage asp panel is out side of this
       updatepanel. And also masterpage asp panel contains a update panel too.

    How can i resolve this issue? really i appreciate if any one can help me in this.

     here is my aspx code

     
    1    <asp:UpdatePanel ID="upnlSearch" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
    2 <Triggers>
    3 <asp:AsyncPostBackTrigger ControlID="ddlDepartment" />
    4 <asp:AsyncPostBackTrigger ControlID="ddlInstitution" />
    5 <asp:AsyncPostBackTrigger ControlID="btnSearch" />
    6 </Triggers>
    7 <ContentTemplate>
    8 <h2><asp:Literal ID="ltHeader" runat="server"/></h2>
    9 <asp:Panel ID="pnlSearch" runat="server">
    10 <table border="0" cellspacing="0" cellpadding="0" width="100%" class="mainSearchForm">
    11 <tr>
    12 <th>Last Name </th>
    13 <td></td>
    14 <td><asp:TextBox ID="txtLastName" runat="server" width="250px" ToolTip="Enter LastName"/></td>
    15 </tr>
    16 <tr>
    17 <th>First Name</th>
    18 <td></td>
    19 <td><asp:TextBox ID="txtFirstName" runat="server" width="250px" ToolTip="Enter FirstName"/></td>
    20 </tr>
    21 <tr>
    22 <th>Department</th>
    23 <td></td>
    24 <td><asp:DropDownList ID="ddlDepartment" runat="server" width="252px" AutoPostBack="true" ToolTip="Select Department Name"/></td>
    25 </tr>
    26 <tr>
    27 <th style="text-align:right;">Institution</th>
    28 <td></td>
    29 <td><asp:DropDownList ID="ddlInstitution" runat="server" Width="252px" AutoPostBack="true" ToolTip="Select Institution"/></td>
    30 </tr>
    31 <tr>
    32 <th style="text-align:right;">Keyword</th>
    33 <td></td>
    34 <td><asp:TextBox ID="txtKeyword" runat="server" width="250px" ToolTip="Enter Publication Keywords"/></td>
    35 </tr>
    36 <tr>
    37 <th style="text-align:right;">Publications</th>
    38 <td></td>
    39 <td><asp:CheckBox ID="ChkPublications" runat="server" Text="Only Show profiles with publications" /></td>
    40 </tr>
    41 <tr>
    42 <th></th>
    43 <td></td>
    44 <td><asp:Button ID="btnSearch" runat="server" Text="Search"
    45 onclick="btnSearch_Click1" /></td>
    46 </tr>
    47 <tr>
    48 <th></th>
    49 <td></td>
    50 <td><asp:Literal ID="LtMsg" runat="server" visible="false" /></td>
    51 </tr>
    52 </table>
    53 </asp:Panel>
    54 <asp:Panel ID="pnlSearchResults" runat="server" Visible="false">
    55 <asp:GridView ID="grdSearchResults" runat="server"
    56 AutoGenerateColumns="False"
    57 AllowPaging="True"
    58 AllowSorting="True"
    59 GridLines="Vertical"
    60 DataKeyNames="UID"
    61 EmptyDataText="'color:#990000'>No matching people could be found</i>"
    62 DataSourceID="Objresults"
    63 OnRowCreated="grdSearchResults_OnRowCreated"
    64 cssclass="searchResultsTable"
    65 Width="580px" >
    66 <PagerSettings
    67 Mode="NumericFirstLast"
    68 Position="TopAndBottom"
    69 PreviousPageText="Previous"
    70 NextPageText="Next" />
    71 <PagerStyle BorderStyle="None" ForeColor="#330099"/>
    72 <AlternatingRowStyle BackColor="#F0F4F6" />
    73 <PagerTemplate>
    74 <table width="100%" class="pagerstyle">
    75 <tr>
    76 <td style="text-align:left"><asp:LinkButton ID="LnkPrev" runat="server" Text="<< Previous" CommandName="Page" CommandArgument="Prev"/></td>
    77 <td></td>
    78 <td style="text-align:right"><asp:LinkButton ID="LnkNext" runat="server" Text="Next >>" CommandName="Page" CommandArgument="Next"/> </td>
    79 </tr>
    80 </table>
    81 </PagerTemplate>
    82 <Columns>
    83 <asp:BoundField DataField="UID" ReadOnly="true" Visible="false" />
    84 <asp:TemplateField HeaderText="Name" SortExpression="Name" ControlStyle-CssClass="institutionLink" >
    85 <ItemTemplate >
    86 <asp:HyperLink ID="hypLnkName" runat="server" Text='<%# Eval("Name") %>' />
    87 </ItemTemplate>
    88 <ControlStyle CssClass="institutionLink" />
    89 </asp:TemplateField>
    90
    91 <asp:TemplateField HeaderText="Institution" SortExpression="Institution">
    92 <ItemTemplate >
    93 <asp:Label ID="lblInstitution" runat="server" Text ='<%# Eval("Institution")%>'/>
    94 </ItemTemplate>
    95 </asp:TemplateField>
    96
    97 </Columns>
    98 </asp:GridView>
    99 </asp:Panel>
    100
    101 <asp:Panel ID="pnlSpotLight" runat="server">
    102 <div class="spotlightTopLine"><h3>Spotlight</h3></div>
    103 <table width="100%">
    104 <tr>
    105 <td style="width:70px"></td>
    106 <td style="width:175px">
    107 <asp:GridView ID="grdMostViewedToday" runat="server"
    108 AutoGenerateColumns="false"
    109 GridLines="None"
    110 OnRowCreated="grdMostViewedToday_OnRowCreated"
    111 DataKeyNames="UID">
    112 <Columns>
    113 <asp:BoundField DataField="UID" ReadOnly="true" Visible="false" />
    114 <asp:TemplateField HeaderText="Most Viewed Today" HeaderStyle-HorizontalAlign="Left">
    115 <ItemTemplate>
    116 <asp:HyperLink ID="hypLnkMostViewedToday" runat="server" Text='<%#Eval("MostViewedToday") %>'/>
    117 </ItemTemplate>
    118 <ControlStyle CssClass="institutionLink" />
    119 </asp:TemplateField>
    120 </Columns>
    121 </asp:GridView>
    122 </td>
    123 <td style="width:175px">
    124 <asp:GridView ID="grdMostViewedMonth" runat="server"
    125 AutoGenerateColumns="false"
    126 GridLines="None"
    127 OnRowCreated="grdMostViewedMonth_OnRowCreated"
    128 DataKeyNames="UID">
    129 <Columns>
    130 <asp:BoundField DataField="UID" ReadOnly="true" Visible="false" />
    131 <asp:TemplateField HeaderText="Most Viewed This Month" HeaderStyle-HorizontalAlign="Left" ControlStyle-CssClass="institutionLink">
    132 <ItemTemplate>
    133 <asp:HyperLink ID="hypLnkMostViewedMonth" runat="server" Text='<%#Eval("MostViewedThisMonth") %>'/>
    134 </ItemTemplate>
    135 </asp:TemplateField>
    136 </Columns>
    137 </asp:GridView>
    138 </td>
    139 <td style="width:175px">
    140 <asp:GridView ID="grdInMyDepartment" runat="server"
    141 AutoGenerateColumns="false" GridLines="None"
    142 OnRowCreated="grdInMyDepartment_OnRowCreated"
    143 DataKeyNames="username">
    144 <Columns>
    145 <asp:BoundField DataField="username" ReadOnly="true" Visible="false" />
    146 <asp:TemplateField HeaderText="In My Department" HeaderStyle-HorizontalAlign="Left">
    147 <ItemTemplate>
    148 <asp:HyperLink ID="hypLnkInMyDepartment" runat="server" Text='<%#Eval("InMyDepartment") %>'/>
    149 </ItemTemplate>
    150 <ControlStyle CssClass="institutionLink" />
    151 </asp:TemplateField>
    152 </Columns>
    153 </asp:GridView>
    154 </td>
    155 </tr>
    156 </table>
    157 </asp:Panel>
    158 <asp:ObjectDataSource ID="Objresults" runat="server" SelectMethod="SearchQuery"
    159 TypeName="Harvard.People.Services.Search" >
    160 <SelectParameters>
    161 <asp:SessionParameter Name="LastName" SessionField="txtLastName"
    162 Type="String" />
    163 <asp:SessionParameter Name="FirstName" SessionField="txtFirstName"
    164 Type="String" />
    165 <asp:SessionParameter Name="Department" SessionField="ddlDepartment"
    166 Type="String" />
    167 <asp:SessionParameter Name="institution" SessionField="ddlInstitution"
    168 Type="String" />
    169 <asp:SessionParameter Name="keyword" SessionField="txtKeyword" Type="String" />
    170 <asp:SessionParameter Name="publications" SessionField="ChkPublications"
    171 Type="String" />
    172 </SelectParameters>
    173 </asp:ObjectDataSource>
    174 </ContentTemplate>
    175 </asp:UpdatePanel>
     

      
  • Re: hyperlinks breaks in updatepanel

    06-30-2008, 3:24 PM
    • Contributor
      2,331 point Contributor
    • mattb
    • Member since 06-21-2002, 4:33 PM
    • Woodbury, MN
    • Posts 530

    Is ViewState enabled?

    Matt Brown
    MetalReview.com - Metal music community and reviews
    Haulix - Easy promotional media distribution for the music industry
  • Re: hyperlinks breaks in updatepanel

    06-30-2008, 4:03 PM

    Are you asking for page viewstate? if so its not enabled

Page 1 of 1 (3 items)