.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

problem with datalist in updatepanel

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :ASP.Net

Hi! i try to make a search part. there is a textbox which will be used for search context. also, i need to list category names. i don't use dropdownlist because its styles(for example border-style)doesn't change. So i tyr to do like this:i use a label and datalist. when clicking the label, datalist is showing. when i click the category name on datalist, it will be shown on label.(label is not in datalist.)my problem starts at that point. when i click category name on datalist , page is being postback. so i put datalist into updatepanel. but this time , i click category name on datlist,nothing occurs.(category name doesn't shown on label).my code is below:

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

View Complete Post

More Related Resource Links

datalist image slide show problem


hi friends

i am binding  images dynamically(back end)for a datalist .iam applying a slideshow for it .I am getting a problem to apply slideshow for dyanmically binded images.If the define in a div statically it working perfectly

for example pls go through my code below:

<script type="text/javascript">
$(document).ready(function() {
        fx: 'scrollLeft' // choose your transition type, ex: fade, scrollUp, shuffle, etc...

<div class="slideshow">
        <img src="images/30_dummy.jpg" width="200" height="200" />
        <img src="images/aquarius.gif" width="200" height="200" />
        <img src="images/star.gif" width="200" height="200" />
        <img src="images/the-proud-indian-flag-1.jpg" width="200" height="200" />

I above code works perfectly and the slide show e

datalist printOut() function Problem

  • i m using below code..by using it i able to write asp data into word file n format it.but i m facing problen in print out..

    it show exception

    Message = "The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))"

    please hav a look at below code....

  •  .................div data...................   
  •   <div id="printdiv" runat="server">   
  •     <table style="border: 5px solid #FF00FF; width:100%">   
  •     <tr>   

  • Problem with UpdatePanel postback

    Hello,I have a Modal Popup window, inside an Update Panel object, that has the following layout:A Title areaA Content area with a tabstrip of 5 tabsA footer area with two buttons (Save and Cancel) and an UpdateProgressIn 3 of the five tabs I have:an UpdatePanel (UpdateMode=Conditional) that wrapsA collection of LinkButtons objectA gridviewAnother Panel object to be showed as a Nested Modal PopupNO update ProgressBoth the link collection and the gridview Select event will open the nested Modal window that contains a custom Usercontrol that is used to add new or edit object of the related gridview like in the code sample below//click handler of the LinkButton protected void btnNewPhone_Click(object sender, EventArgs e) { //Setup properties of the UserControl code omitted // ... //Show the nested Popup this.mpePopupPhone.Show(); } //handler for the gridview selectedIndex event protected void gvPhones_SelectedIndexChanged(object sender, EventArgs e) { //Setup properties of the UserControl code omitted // ... //Show the nested Popup this.mpePopupPhone.Show(); } Please note that: I am using the ModalPopupExtender show/hide behaviors using only server-side code. Also, the ModalPopupExtender objects for nested modal windows does not have the OkControlID & CancelControlID set. As the content of nested modal window is only a single user contro

    DataList and DetailsView problem

    I have a problem hooking up the datalist to the details view. I know everything server side is fine cause the default values work, but I guess I am not getting post back from the datalist. Here is my code.<div id="thumbnail">                     <asp:DataList ID="DataList1" runat="server" DataSourceID="ObjectDataSource2"                          RepeatDirection="Horizontal" DataKeyField="ItemsID">                         <ItemTemplate>                             <asp:ImageButton ID="Image1" runat="server" ImageUrl='<%# "Handler.ashx?ItemsID=" + Eval("ItemsID")%>'/>                             <asp:Button ID="button1" runat="server" Text='<%# Eval("ItemsID") %>' />                         </ItemTemplate>                     </asp:Dat

    Problem with Dynamic Controls inside an UpdatePanel

    Hello Everybody ,I have this problem,if anyone could help me i'll be so gratefull. I had been created some dynamic radio buttons in a loop inside a dinamy table which is inside an UpdatePanel , but i can not handle the events my code is below:public void MetodoCreacion(){RadioButton RBtn = null;Table table = new Table();TableRow row = null;TableCell cell = null;for (int i = 0; i < 5; i++){row = new TableRow();cell = new TableCell();RBtn = new RadioButton();RBtn.ID = "RBGN_" + i.ToString();RBtn.GroupName = "RBGN1";RBtn.Text = "Opcion " + i.ToString();RBtn.CheckedChanged += new EventHandler(RBtn_CheckedChanged);RBtn.AutoPostBack = true;cell.Controls.Add(RBtn);row.Controls.Add(cell);table.Controls.Add(row);}UpdatePanel1_UpdatePanelAnimationExtender.Controls .Add(table);}public void RBtn_CheckedChanged (object sender, EventArgs e){Label1.Text = ((RadioButton)sender).ID;}and the controls doesent call the event ...thanks a lot

    Problem in "Upload a picture into data base" because is in

    Hi guys. I can upload a picture into database by this code correctly in a web page without "UpdatePanel": ******************************** SqlConnection connection = null; try { Byte[] imgByte = null; if (FileUpload.HasFile && FileUpload.PostedFile != null) { HttpPostedFile File = FileUpload.PostedFile; imgByte = new Byte[File.ContentLength]; File.InputStream.Read(imgByte, 0, File.ContentLength); } // Insert the employee name and image into db string conn = "Data Source=PC5;Initial Catalog=LaptopStore;Integrated Security=True"; connection = new SqlConnection(conn); connection.Open(); string sql = "INSERT INTO test(image) VALUES(@image) SELECT @@IDENTITY"; SqlCommand cmd = new SqlCommand(sql, connection); cmd.Parameters.AddWithValue("@image", imgByte); int id = Convert.ToInt32(cmd.ExecuteScalar()); lblResult.Text = String.Format("Employee ID is {0}", id); } catch { lblResult.Text = "There was an error"; } finally { connection.Close(); } ******************************************** But when I want to use this code in a

    Problem with datalist paging


    I having a little problem to get the paging for my datalits to work. I have used this article: http://aspalliance.com/157 which i found do the things i wanted. I have implemented the code but no records show at all.. No errors.. Can anybody see what i have done wrong? Thank you!

    Here is my aspx code:

    <h2 align="center"><font face="verdana">Paging in DataList</font></h2>
    <a name="this"></a>
    <asp:DataList ID="dList" Runat="server" Width="100%"
    <table width="100%" style="font: 10pt verdana" cellpadding=0 cellspacing=0>
    <tr style="background-color:FF0000">
    <th align=left><font color="#FFFFFF">Store ID</font></th>
    <th align=left><font color="#FFFFFF">Order Number</font></th>
    <tr style="background-color:#f5f5dc">
    <td><%#DataBinder.Eval(Container.DataItem, "pName")%></td>

    Refreshing datalist in updatepanel


    I have a datalist. When a user clicks a button in the datalist I change some properties and then want to refresh the datalist. However, the code below doesnt seem to refresh the datalist. Once I reload the entire page (which I dont want) the changes are visible in the datalist.
    I also tried setting the updatemode of the updatepanel to "Conditional" and update manually in the dlPhotos_ItemCommand, but that doesnt work either.

    In bold I've marked where I want to refresh the datalist

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

            <cc1:AsyncFileUpload ID="afuPhoto" runat="server" />

            <asp:DataList ID="dlPhotos" DataSourceID="dsPhotos" DataKeyField="id" RepeatColumns="5" RepeatDirection="Horizontal" GridLines="None" runat="server" >
                <asp:Button ID="btnSetThumbnail" CommandName="setthumb" CommandArgument='<%# stri

    Star rating in Datalist problem


    I have a user comments area that people can add their comments to the page.  I have successfully gotten the star rating to save into the database.  I now want to display the star rating into a datalist.

    Here is what I have so far:

    <asp:DataList ID="DataList1" runat="server" CellPadding="3"
                    DataSourceID="dsHotelComments" Visible="False" BackColor="White"
            BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"
        GridLines="Horizontal" Width="843px">
                    <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                    <AlternatingItemStyle BackColor="#F7F7F7" />
                    <ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                    <SelectedItemStyle BackCo

    update datalist in updatepanel after asyncfileupload has uploaded a new file


    I want to update an updatepanel after the user has uploaded a photo via the asynfileupload control.

    Below is my current code. I also tried setting updatemode="conditional" to "false" and then in code-behind call upnlPhotos.update, but without luck...

    Upload photo: <cc1:AsyncFileUpload ID="afuPhoto" runat="server" /><br />

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

        <asp:DataList ID="dlPhotos" DataSourceID="dsPhotos" DataKeyField="id" RepeatColumns="5" RepeatDirection="Horizontal" GridLines="None" runat="server" >
            <img alt="" src='/images/trouwlocatiefotos/thumbs/<%# Eval("locpath")%>' /><br />            

        <asp:SqlDataSource ID="dsPhotos" SelectCommand="SELECT id,locationid,locpath from location_photos lp where locationid=@locationid" ConnectionString="<%$ConnectionStr

    Problem with Editing image inside DetailsView inside UpdatePanel



    I have a problem and I really hope you'll be able to help me.

    I'm trying to add and edit an image which is located in a detailsview which is inside an UpdatePanel. After I read relevant topics in the forum I installed the Ajax Control Toolkit. Below is my source code. When I used it only for insert new image it worked great. The problem caused when I tried to implement it on the Edit mode, i.e. when I tried to edit the image and upload a different image.  Unfortunately it didn't work as I hoped. Nothing happend and the image hasn't been changed. I also tried to change the IDs (AsyncFileUpload ID) to be the same in both places but it didn't work either.

    The source code:

    <asp:DetailsView ID="dvMovie" runat="server" Height="50px" Width="695px"
                        AutoGenerateRows="False" DataSourceID="sdsMovieById"      
                         BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"

    Problem filling labels with table data outside datalist using single call to db


    On a single page, I'd like to fill 2 hyperlink controls as well as a datalist control with table data using one call to the database. The page looks like this:

    <div id="PageContent">    
          Please select the district you wish to view below.</p>
          <asp:DropDownList ID="ddlDistrict" runat="server" CssClass="textbox" 
            DataTextField="DistrictName" DataValueField="DistrictId" AutoPostBack="True" 
        <p><asp:label ID="lblDistrictAbbrev" runat="server" Text="District Abbreviation: " />
          <asp:hyperlink ID="hyperlinkDistrictName" runat="server" 
            Text='' NavigateUrl="~/Contact/NationalCouncil.aspx" 
            Font-Bold="True" />
        <p><asp:label ID="lblDistrictCouncillor" runat="server" Text="District Councillor: " />
          <asp:hyperlink ID="hyperlinkCouncillor" runat="server" 
            Text='' NavigateUrl="~/Contact/NationalCouncil.a

    Serious problem on UpdatePanel and GridView (Input string was not in a correct format)


    I have implemented a custom gridview paging method using the pagertemplate tag. The source code is the following:



    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
          		<fieldset class="ads">
    			<br />            
                <asp:GridView ID="gvResults" runat="server" AutoGenerateColumns="False" DataKeyNames="CHId" CssClass="grid" GridLines="None" AllowPaging="true" AllowSorting="true&q

    updatepanel problem for IE


    hi i have update-panel which works fine in Google chrome, Mozilla, but not in IE(6,7 and 8). when i click refresh button postback is happening.

    Any suggestions plz

    Thank you


    asp .net updatepanel problem......



    i am using 2 ddl, 1 gridview & 3 update panels for each in my page.

    now  i want update my gridview, when any ddl was changing.....

    how to do this....



    Problem with the modal popup within a asp updatepanel


    Where is the Problem with the popup within a asp updatepanel.

    It works fine in IE8. But in FireFox (Version 3.6.11) it works only sometimes.

    ASP-Control for PopUp (PopUp.ascx):

    <asp:UpdatePanel ID="UIUpdatePanel" runat="server" UpdateMode="Conditional">
    			<div class="sectionheader">
    				<asp:Label ID="UILabelHeadLine" runat="server" />
    			<table class="exportPopupTable">
    					<td style="width:200px;">
    						<asp:RadioButton ID="UIRadioButton1" runat="server" Checked="true" />
    					<td rowspan="6" class="helptextcolumn">
    						<asp:Label ID="UILabelInfoText" runat="server" />
    						<asp:RadioButton ID="UIRadioButton2" runat="server" />
    					<td align="right" colspan="2">
    						<asp:Button ID="UIButtonOk" runat="server" OnClick="UIButtonOk_Click" ValidationGroup="FinishDateTime" />
    						<asp:Button ID="UIButtonCancel"

    ajax - Nested Datalist in Updatepanel



    I need to input nested data (data entry) and i am using datalists for the same. The details include many details and I am managing the same using controls for each in information.

    The parent datalist can have max 20 rows with 7 rows in each child datalist. I tried to bind the datalists with max rows, due to which the rendered page size was almost 12MB and it took more than 2 mins to load.

    Alternative to this, I put the parent datalist in updatepanel and bound it to one row initially.  Onclick of add button, i implemented an asynchronous postback to add new row to the parent datalist datasource and update the updatepanel to display the datalist.  The new row is displayed properly in datalist, however it gets reset to original datalist after some seconds.

    I have no clue about the reason for it. Please help me to resolve the above issue.


    ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
    Sql Server  SharePoint  Silverlight  Others  All   

    Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend