.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

File upload control and update panel ... ab-normal behavior?

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :ASP.Net
 I have two update panels on single page . 1st one contain drop down and some other controls. I have used asyncpostbacktrigger in 1st update panel.  while in second PostBackTrigger (because of file upload). When page loads , it first dislays the content of 1st udate panel, when I click button to show the content of 2nd update panel , its contents are not displayed. look at this code, it demonstrates what I mean to say. <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:panel ID="pnl" runat="server"> <asp:DropDownList ID="drpdwn" runat="server"> <asp:ListItem>Item 1</asp:ListItem> <asp:ListItem>Item 2</asp:ListItem> </asp:DropDownList> </asp:panel> <asp:Button ID="lnkbtnNext" runat="server" Visible="false" onclick="Button1_Click" Text="Next" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="lnkbtnNext" /> </Triggers> </asp:UpdatePanel> <asp:UpdatePanel ID="updpnl3" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:PlaceHolder ID=&qu

View Complete Post

More Related Resource Links

File Upload Control is not working in Update Panel

hi friend... i am using update panel... in one of my aspx page (ASP.NET 2.0)there is a file upload control in update panel which is used to upload company logo on server..when i remove the update panel.. than file upload is working properly..but when i again place an update panel then file upload control is not working and its giving me error.. in likeIf String.IsNullOrEmpty(fldLogo.PostedFile.FileName.ToString) Then                 as object reference not set to an instance of an object... can any body help me ?any idea ??  

Accordion Control with Panel...Add an Update Panel?


I have an accordion control in my web site.  And in one of the panels, I have a drop down list box where, when the user selects an item, it updates the labels right below the ddlistbox.  I have it so that it maintains the scroll position when the ddlistbox has an autopostback, but it's very obvious that the whole page posts back.

My question is, can I/should I just enclose the ddlistbox and the labels (and a couple of text boxes) in an AJAX update panel?  I already have a ToolScriptManager (because of the accordion control), so I don't need to have another script manager, right?  I can just put the update panel (with the other controls inside of it) right in the accordion panel, right?  Then when the ddlistbox posts back it won't have the delay of the whole page posting back?  And it'll still execute the event handler for the listbox selection change?

Does this sound right?  I'm just looking to make the post back "invisible", and I would like to do a partial postback of just these few controls.

Thanks in advance! :)

Reg File Upload control to upload files from document library


In Field Upload control if we click browse button it allow us to search file in our hard disk but now as per my requirement as soon as user clicks ‘Browse’ button it should point to the document libraries and their files in site.Let me know how could i achieve this?

Thanks & Regards,


changing records frm control in update panel


i have a list box, a command button and a grid

when i click a particular record / or multiple records on the  list box and then cclick the command button the records r transferred 2 the grid

i also have custom paging, the paging shld ocur as many times i clcik the command button

i have used updatepanel with the command button in it so that partial postback ocurs or there is no page flicker ,

but when i use update panel i get teh records in the grid but custom page is not working . it has no affect even if the records are added

if i remove update panel the paging works properly

how do i manage it with update panel

Upload file control intefering with javacript and Sys.WebForms.PageRequestManager.getInstance?

Ok I'm trying to use the dreaded Upload File control and it's not within an UpdatePanel. Here's what I have, I'm using jQuery to display messages on the client side from the server. One of the things I'm doing is I'm setting up a script to run using: Sys.WebForms.PageRequestManager.getInstance().add_endRequest(iamloading); and in my iamloading I have: function imaloading() {    $(document).ready(function () {        displayMessage();    }) } Not to bore you with details but the displayMessage is where I am doing the jQuery, this has worked for ever.Now I'm building this page with the Uploadfile control and this stops working and if I remove the control it works again.I've made sure that the function handler is created for iamloading but it never fires as though something has unregistered the event. Any help or suggestion would be of great healp.Thanks    

File Upload Server Control

I have a FileUpload Control on a Content page of a Master Page. I need to upload an image and display it before user can upload it. Can someone advice (with example if possible)  what FileUpload event will notify me that a file was selected so I can than display it? Is this the best way to perfom this task? Can anyone advice of a better way?

how can i replace a file from a directory using file upload control and c# in a web applicatin

i m developing a web based appllication with asp.net and c#. I want to replace a file that is in a directory by code.

Why is the "attach file" control not active, if I try to upload a file as an anonymous user within a

Hi everybody! We try to design an online application form and implement an infopath form over a form webpart! Meanwhile, I'm able to see the form as an anonymous user and I can enter the specific informations, but unfortunately I'm not able to attach a file, because the control is not aktive! Does someone have an idea, why?   Thanks for your replies    

Update panel with WebChart Control not happening :(

Hi guys,I have a drop down list with questions, according to selected question a chart is generated, when you enter the page and select a question for the first time, the chart gets generated correctly, but then when you select another question update panel doesn't show the updated chart (all charts are working, if i test the questions manually).Here is the update panel that i have:<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline">             <ContentTemplate>                   <Web:ChartControl ID="ChartControl1" runat="server" BorderStyle="Outset"                         BorderWidth="5px">                    </Web:ChartControl>                </ContentTemplate>             <Triggers>               

How to determine if a user control is contained by the update panel that triggered async postback

Does anyone know a simple way to determine if a user control is contained in an update panel that was triggered for async postback?At the moment, the only pseudo logic for this I can think of is?'Loop through the update panel controls on the page and find the one that is involved in the postback (isInPartialRendering)'Try to find the user control as a child of the update panel

ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error

RE: ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error Two Issues, apparently unrelated. I have subfolders like this /ApplicantDocuments/20 and /ApplicantDocuments/21 (where 20 and 21 are my subfolders and ApplicantDocuments is my library. 1. The below function is erroring with file not found, but I confirmed I'm sending the fully qualify path (i.e c:\test.txt) to System.IO.FileStream content = System.IO.File.Open(documentFileName, System.IO.FileMode.Open); 2. Even if it worked, looking at the code, I'm not using argument foldername.  I'm passing 20 to the argument. How can I make sure it uploads into subfolder 20 of ApplicantDocuments? Thank you.     Just testing in test environment. Will tighten code once it works.   public void UploadDocumentToSite(string foldername, string documentFileName) {      SPSite siteCollection = new SPSite("https://xxxxxx");      SPWeb web = siteCollection.OpenWeb();      //SPSite.AllowUnsafeUpdates = true;      //Web.AllowUnsafeUpdates = true;      string Lib = "ApplicantDocuments";      SPFolder destFolder = web.GetFolder(Lib);      sendmail(documentFileName+" "+foldername);  

Ajax & Async File Upload Control

i want to use new Async File Upload Control without updating the new dll.because in new dll modal popup extender and link button generates postback.I want to devlop a same control is there any way to develop Async File Upload Control?Can we use the Source Provided in Ajax Tool Kit?

User Control with JQuery doesnot work inside update panel


Hi All,

I created a .NET user control to work as a DropdownCheckbox and added Jquery to give the sliding and hide effects. The code is as below:

 <script language="javascript" type="text/javascript">
        var showRegionWindow = function (ev) {
            var pos = $("#lnkChangeRegion").offset();
            var width = 230;
            var height = 55;
            //$("#changeRegionPanel").css({ "left": +((pos.left) - 215) + "px", "top": height + 16 + "px" });.
            document.getElementById("lnkChangeRegion").style.display = 'none';

        var hideRegionWindow = function (ev) {
            var textVal = "";

Dynamic Control in update panel



I am developing a page where i am generating dynamic control in Update panel. I am getting eror when I am assigning trigger's control ID.


  private void LoadControls(string strGridId, DateTime dtGridDate, bool bAllocReadonly)
            pnlSectorGrid.Visible = true;
            DataSet ds = GetSectorialGridData(strGridId, dtGridDate);
            Table table = new Table();
            table.ID = "Table1";

            for (int Index = 0; Index < ds.Tables[0].Rows.Count - 1; Index++)
                TableRow row = new TableRow();
                TableCell cell1 = new TableCell();
                TableCell cell2 = new TableCell();

                Label lblSectorName = new Label();
                lblSectorName.Text = ds.Tables[0].Rows[Index]["tsu_SubSectorName"].ToString();
                lblSectorName.Font.Size = 10;

                TextBox txtAlloc = new TextBox();
                txtAlloc.Text = ds.Tables[0].Rows[Index]["Alloc"].ToString();
                txtAlloc.Font.Size = 8;
                txtAlloc.Width = 90;
                txtAlloc.ReadOnly = bAllocReadonly;

File upload control and not permitting user to upload over 500px in WIDTH ??




I have a file upload control on my page with a regular expression validator that handles the file format.


Users can upload files but I want the maximum WIDTH size to be 500px.


If any bigger I need to show a message advising the width is to great and stops them.


Thanks for any solutions



Problem with User Control, Update panel and flicker


I have  block of code that consists of a textbox a button and a dropdown. The text entered in the text box filters the dropdownlist when the user clicks the button. The Ajax works great when it is in a simple page but if I put the same code in a User control I get flicker. Can anyone assist with this issue?

page inside update panel doesn't refresh the session object after postback of any control



I have many controls like dropdown, radiobuttonlist, etc on my page and I put all these controls inside the update panel so that the page doesn't look to be posting back when something is selected. Now the working on the page is very smooth. But the session object isn't getting refreshed even if I postback to the server and as a result even if the users are working on the page they are being sent to the login screen after 20 mins.

Is there anyway where I could put all the controls in update panel and still refresh the session after any postback(dropdown selection)

Any help is greatly appreciated.

Thanks in advance

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