.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

AsyncFileUpload inside FormView not working

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :ASP.Net
I'm having a lot of problems with something seemingly simple, and from other posts sounds like people have been able to do. I have a FormView inside a user control, and in the InsertItemTemplate, I have an AsyncFileUpload control, that I would like to to use. On the user side, it seems to work, but it doesn't work on the server side code behind. The HasFile Property is always false, and it doesn't fire the UploadCompleted event either. My UpdatePanel is in the master page. Any ideas? Thanks <asp:FormView ID="frmAddImage" runat="server" DataKeyNames="imageID" DataSourceID="sqlImages" Width="100%"> <InsertItemTemplate> <cc1:AsyncFileUpload runat="server" ID="FileUploadImage" Width="400px" UploaderStyle="Traditional" CompleteBackColor="Lime" ErrorBackColor="Red" onuploadedcomplete="AsyncFileUpload_UploadedComplete" UploadingBackColor="#CCFFFF" />  

View Complete Post

More Related Resource Links

The Working Programmer: Inside SQLite


After tackling NoSQL, Ted Neward turns back to the relational world of SQL-SQLite, that is. Learn all about the lightweight, embedded database whose running footprint can be as small as one file installed in a client file system.

Ted Neward

MSDN Magazine August 2010

Dealing with a databound DDL inside formview when SelectedValue no longer exists

Hi forum heros!  I have a page that has a formview on it.  Client info, name, address, usual stuff.  The formview is populated by a DataSource, that calls a SQL stored procedure for the client info.  It all works great. Within the formview, I have a dropdownlist for the Staff assigned to the client (StaffId is a member of the Client record called during the Formview binding).  When the formview is in Item mode, the Staff name appears in a label, when in Edit mode, the dropdownlist is bound and populated by another DataSource that calls a stored procedure of ActiveStaff. When the assigned staff exists, the StaffId is correctly bound to the DDL SelectedValue and the current staff name appears selected in the DDL when in edit mode, as it should. So here's the problem: Staff quit and become inactive.  So when the client record is pulled up, the StaffId (bound from the Formview) is no longer in the ActiveStaff list (used in the DDL) and the DropDownList bind fails (loudly - not sure why it couldn't just fail to zero, but there you go). Anyway, I know how to check for whether a record exists and manually bind dropdownlists that are outside formviews, but is it even possible within a formview? Any direction here would be appreciated. Thanks in advance.  

Image stretch inside a grid stops working horizontally once columns are added to grid.

I have a simple setup of a window. Window contains a grid, inside the grid there is an image. I want the image to always stretch across the entire cell. I've set it's Stretch property to Fill and it works fine, as long there is only one column in the parent grid. As the window is resized, the image stretches correctly. As soon as I add another column, the image stops stretching horizontally. Vertially it works just like before, horizontally it now appears with a fixed width corresponding to the width of the picture used as the source. Does not matter which column it's positioned in, and I've tried encapsulating it into another grid but behaviour does not change. It behaves the same in both Visual studio 2010 designer and at runtime. In addition when I tried to encapsulate it in a second grid, this seond grid also now has altered behavior - instead of sizing itself to it's container (both height and width are not set) as it's parent grid does, it now sizes itself to its contents - the image. But only horizontally. What is going wrong here, is this a bug or am I missing something, and any advice on how I can get the image to fill one of the cells of a grid with more then one column?

Alert not working when used with image inside gridview

I am currently using following code to set alert on required column of my grid. When I change button type to Image the alert appear after completion action. Any quick suggestion??   My code is below.. protected void grdDelTempList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[6].Attributes.Add("onClick", "javascript:return confirm('Are You Sure?');"); } }    

DropDownList inside FormView Insert Template

Hi, I am trying to change the textboxes in the FormView insert template to dropdownlists but they keep setting the parameters to null.   Here's what I have:  <asp:DropDownList ID="ddlYearOfQualification" SelectedValue='<%# Bind("YearOfQualification") %>' runat="server"> </asp:DropDownList> In Page_Load CType(frmSurvey.FindControl("ddlYearOfQualification"), DropDownList).Items.Add(New ListItem("2010", "2010"))CType(frmSurvey.FindControl("ddlYearOfQualification"), DropDownList).Items.Add(New ListItem("2009", "2009"))   and in the SqlDataSource InsertCommand="INSERT INTO [tblSurvey] (... [YearOfQualification] ...) VALUES ( ... @YearOfQualification ... ) And in insert parameters: <asp:Parameter Name="YearOfQualification" Type="Int16" /> And the insert fails with YearOfQualification as null. If I sue the standard textbox: <asp:TextBox ID="YearOfQualificationTextBox" runat="server"                 Text='<%# Bind("YearOfQualification") %>' /> It works.   Any ideas? Many thanks in advance.

Selected value of RadioButtonList inside a formview get cleared on button click.

Hi all,I placed a RadioButtonList inside a Formview control.And from  DataBound event handler of formview ,RadioButtonList is binded to the datasource .Now my problem is after selecting a value from radiobuttonlist and I click any button,the radiobuttonList get unchecked and lose the selected value .How can I avoid this.Please help..

ReportViewer inside UpdatePanel not working


Has anyone been able to get the ReportViewer to work correctly inside an UpdatePanel?

For me the report renders fine on the initial whole-page refresh, but when I click the next page button the next page renders but doesn't allow me to navigate through the pages anymore. The toolbar says "(blank) of 0" pages and the arrow toolbar buttons for navigating between pages are all disabled.

Ajax AsyncFileUpload control not working in IE7.0 and IE8.0 browser in Integrated Windows Authentica



I am facing problem using Ajax AsyncFileUpload control in IE7.0 and IE8.0 browsers. 

It is working fine in local environment, when you deploy the code in Windows Server 2003 (IIS6.0) with Integrated Windows Authentication mode it is not working properly in IE7.0 and IE8.0 browsers. 


I am doing the validation in client side using OnClientUploadStarted, OnClientUploadComplete it is working fine but once click on any other button (server side) getting the error Internet Explorer cannot display the webpage (Diagnose Connection Problem) in IE7.0 and IE8.0 browser. Same thing is working fine in other browsers.

Panels inside Formview


I have a FormView, and I want to put a panel inside it's EditTemplate and then acess it when the dropdown is changed so that the FormView calls Edit. Then they will become visible. How can I call them to visible if I can't reach them?

So, how can I make Panels inside EditTemplate in FormView as variable reachable so I can change their visibility?

            "PanelRegSala.Visible = true;
            PanelBusca.Visible = true;
            PanelGrid.Visible = true;"

"<asp:Panel ID="PanelRegSala" runat="server" Visible="False">
          <asp:FormView ID="FormViewRegSala" runat="server" DataSourceID="SQLDSRegSalas" DataKeyNames="idSala">

asynchronous fileupload inside formview


Hi All:
I have a page with master page. On that page there is a formview inside updatepanel.  Form view has asynchronous file upload control. Its uploadcomplete event is never hit. Can you please suggest me solution for it ?
 <asp:FormView ID="dvCustomerDetail" runat="server" DefaultMode="Edit">

ajax AsyncFileUpload control is not working with IE9


AsyncFileUpload  not working with IE9. only on capability mode

overflow:auto not working inside updatepanel


Hi all:
I have a div and a css class that gives overflow. but when i add this div inside updatepanel. overflow:auto doesnt work any solution ?
 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                <div id="mycontent" runat="server">

Postbacktrigger inside Formview


Hi All:
I have a formview inside modalpopup which is inside updatepanel.  The formview contains a button. I want to add postbacktrigger to updatepanel. but when i add postback trigger, I get error that button is not found as it is enclosed in formview. How can I add postback trigger. Also, I dont want the popup to be closed when that button is clicked. 
Please suggest me solution.

textchange event not working from textbox on formview


Hello guys.  I have a formview which in insertmode is required to assign a value to a textbox from another on textchange event.  I can't get it working.

here's formview code (in bold:  event call:

<asp:FormView ID="fvPrecios" runat="server" AllowPaging="True" DataSourceID="OdsPrecios"
        Style="position: relative" CellPadding="4" ForeColor="#333333"
        DataKeyNames="precnume" >
            <table style="position: relative" width="400">
                    <td style="width: 62px; height: 26px">
                        <asp:Label ID="lblEditNombre" runat="server" Text

Formview paging not working with objectdatasource and viewstate setup


I was able to get the formview bound to the objectdatasource, it works great for the first record, but when i select the next record it gives me error  below is all my code, if there is something else that i need to post please let me know.


I opt'd for using formview since it has paging ability.. But now that i got that working, selecting the next record gives me an error.

This is what i have as my button event:


        protected void btnSearchHealthRecords_Click(object sender, EventArgs e)
            if (ddlVehNum.SelectedValue == "0")
                rfvVehNum.IsValid = false;
                ObjectDataSource1.SelectMethod = "HealthRecords";
                ObjectDataSource1.SelectParameters.Add("vehiclenum", TypeCode.String, ddlVehNum.SelectedValue.ToString());

                ViewState["MethodName"] = "HealthRecords";

                FormView1.Visible = true;

                Session["btClick"] = "5";
                sn.Visible = true;


        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)

Crystal Report Export and Print button not working inside UpdatePanel



Iuse UpdatePanel for my pages, clients requested to view pages without flickering.

So, I put all component in update panel, but after that, export and printing for Crystal Reports stoped to work. If I put report viewer outside of updatepanel its working.

Have anyone this problem? There's some solution for this?

Thanks, Paul

Javascript allert inside AJAX UpdatePanel not working


I am having problems with alert box not popup when I'm using AJAX UpdatePanel. The following is what I have and it's not working.

1    ClientScriptManager csm = Page.ClientScript;
3    if(!csm.IsStartupScriptRegistered(this.GetType(), "winPop"))
4    {
5    	csm.RegisterStartupScript(this.GetType(), "winPop", "alert('Update is successful');", true);
6    }

I have to stress that the reason why it does not work is because I'm using AJAX UpdatePanel. If I turned off the AJAX UpdatePanel then it works perfectly. So does anyone have solution to go around this AJAX UpdatePanel 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