dropdown values are bound with database.if select others in dropdown and it will show the empty textbox.but after putting the cc1:AsyncFileUpload in that web page ,before selecting the image it will work fine.but after selecting the image ,it will display
image in image control is working fine.but the dropdown is not working fine.if select others in dropdown it wont show the textbox..
Well, if your working on such things you probably already know that the regular FileUpload control does not work in an async context. In detail the postback, which causes the file to upload may not be an Ajax style async postback. So in order to use a regular
FileUpload within an UpdatePanel the postback button would have to be registered for non-async postback. This solution works, but I didn't analyse the cause further.
As mentioned earlier the AsyncFileUpload control adresses this issue by using an iframe to redirect the postback. This is done by modifing the target of the form on the page. This way the page state is present when the file is uploaded an the DownloadComplete
event occurs. But it doesn't work in the reverse order. So if you call the UpatePanel Update method, this happens in the iframe but does not affect the visible page. In order to force the postback after the download is complete I used the client-side DownlaodComplete
event. You can easyly assign an javascript postback function to OnClientDownloadComplete in your markup.
In my solution I was developping a custom control. This control does implement the IPostbackEventHandler interface and thus it used the GetPostBackEventReference function to get the javascript code.
thank u so much for your valuable comments.other an issue in this page is on FileUploadComplete(object sender, EventArgs e) event is completed then it show the image control in that web page.finish this process, i have a forum with submit
separately in that web page.after complete filling the forum and click submit means,again it will fire the event FileUploadComplete(object sender, EventArgs e) and showing the error that image not yet selected...
how do i use normal file upload for my scenario???
my scenario is if click filepload means it will open a dialog and shows the system file.if i select the image and that image will display in image control in that web page without another button...is it possible to do this using normal file upload??
if yes, pls provide your coding or otherwise tell some sites for reference for my problem
i tried this also friend..but its not working...i cleared all the errors except one that is
.other an issue in this page is on FileUploadComplete(object sender, EventArgs e) event is completed then it show the image control in that web page.finish this process, i have a forum with submit separately in that web page.after complete filling the forum
and click submit means,again it will fire the event FileUploadComplete(object sender, EventArgs e) and showing the error that image not yet selected...
defaultly calling the event FileUploadComplete(object sender, EventArgs e) ...how to fix this error?
girikas
Member
67 Points
321 Posts
cc1:AsyncFileUpload stopped working updated panel??
Aug 09, 2012 06:56 AM|LINK
<script type="text/javascript"> function uploadStarted() { $get("Img_Show").style.display = "none"; } function uploadComplete(sender, args) { var Img_Show = $get("Img_Show"); // Img_Show.src = "images/loader.gif"; Img_Show.style.cssText = ""; var img = new Image(); img.onload = function () { Img_Show.style.cssText = "height:200px;width:209px;float:left;margin-bottom:0;position:absolute;margin-right: 0;left:0px; top:0px;padding-bottom: 15px;padding-left: 15px;padding-right: 15px;padding-top: 15px;"; Img_Show.src = img.src; }; img.src = "<%=ResolveUrl(UploadFolderPath) %>" + args.get_fileName(); ; } </script> <img alt="" src="images/profilepic.jpg"> <asp:Image ID="Img_Show" runat="server" ></asp:Image> <div Class="profilebtn" style="position:relative;"> <asp:Label ID="lblphotoo" runat="server" Text="Add Photo"></asp:Label> <cc1:AsyncFileUpload OnClientUploadComplete="uploadComplete" runat="server" ID="AsyncFileUpload1" ThrobberID="imgLoader" OnUploadedComplete="FileUploadComplete" Width="100" OnClientUploadStarted = "uploadStarted"/> </div><asp:UpdatePanel ID="upBusinessType" runat="server"> <ContentTemplate> <asp:DropDownList runat="server" ID="ddlBusinessType" Style="width: 400px;" OnSelectedIndexChanged="ddlBusinesstype_SelectedIndexChanged" AutoPostBack="true" CssClass="designer" TabIndex="8"> </asp:DropDownList> <asp:Panel ID="PanelBusinessType" runat="server"> <asp:TextBox ID="txtNewBusinessType" runat="server" CssClass="textfield" TabIndex="9"></asp:TextBox> </asp:Panel> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="ddlBusinessType" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel>dropdown values are bound with database.if select others in dropdown and it will show the empty textbox.but after putting the cc1:AsyncFileUpload in that web page ,before selecting the image it will work fine.but after selecting the image ,it will display image in image control is working fine.but the dropdown is not working fine.if select others in dropdown it wont show the textbox..
how do fix this error? pls guide me friends...
SohailShaikh
Contributor
6119 Points
1167 Posts
Re: cc1:AsyncFileUpload stopped working updated panel??
Aug 09, 2012 07:10 AM|LINK
Well, if your working on such things you probably already know that the regular FileUpload control does not work in an async context. In detail the postback, which causes the file to upload may not be an Ajax style async postback. So in order to use a regular FileUpload within an UpdatePanel the postback button would have to be registered for non-async postback. This solution works, but I didn't analyse the cause further.
As mentioned earlier the AsyncFileUpload control adresses this issue by using an iframe to redirect the postback. This is done by modifing the target of the form on the page. This way the page state is present when the file is uploaded an the DownloadComplete event occurs. But it doesn't work in the reverse order. So if you call the UpatePanel Update method, this happens in the iframe but does not affect the visible page. In order to force the postback after the download is complete I used the client-side DownlaodComplete event. You can easyly assign an javascript postback function to OnClientDownloadComplete in your markup.
In my solution I was developping a custom control. This control does implement the IPostbackEventHandler interface and thus it used the GetPostBackEventReference function to get the javascript code.
Mark as your answer if you think its help you
Sohail Shaikh
Sohail Shaikh
girikas
Member
67 Points
321 Posts
Re: cc1:AsyncFileUpload stopped working updated panel??
Aug 09, 2012 07:22 AM|LINK
hi SohailShaikh,
thank u so much for your valuable comments.other an issue in this page is on FileUploadComplete(object sender, EventArgs e) event is completed then it show the image control in that web page.finish this process, i have a forum with submit separately in that web page.after complete filling the forum and click submit means,again it will fire the event FileUploadComplete(object sender, EventArgs e) and showing the error that image not yet selected...
how do fix this error???
pls guide me friends
SohailShaikh
Contributor
6119 Points
1167 Posts
Re: cc1:AsyncFileUpload stopped working updated panel??
Aug 09, 2012 07:42 AM|LINK
please use normal file upload
then use update panle trigger
and
please mark as your answer if you think its help you
Sohail Shaikh
Sohail Shaikh
girikas
Member
67 Points
321 Posts
Re: cc1:AsyncFileUpload stopped working updated panel??
Aug 09, 2012 07:53 AM|LINK
how do i use normal file upload for my scenario???
my scenario is if click filepload means it will open a dialog and shows the system file.if i select the image and that image will display in image control in that web page without another button...is it possible to do this using normal file upload??
if yes, pls provide your coding or otherwise tell some sites for reference for my problem
pls guide me friends
SohailShaikh
Contributor
6119 Points
1167 Posts
Re: cc1:AsyncFileUpload stopped working updated panel??
Aug 09, 2012 08:11 AM|LINK
no its not possible with a single button
you have to use another button
Mark as you answer if you think its help you
Sohail Shaikh
Sohail Shaikh
girikas
Member
67 Points
321 Posts
Re: cc1:AsyncFileUpload stopped working updated panel??
Aug 09, 2012 09:11 AM|LINK
sorry my friend..tats my requirement..can u pls update for that??
pls guide me friends
SohailShaikh
Contributor
6119 Points
1167 Posts
Re: cc1:AsyncFileUpload stopped working updated panel??
Aug 09, 2012 09:16 AM|LINK
ok did you use this metod
protected void AsyncFileUpload1_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
{
Image1.ImageUrl="Image Path"
}
Mark as your Answer if you think its help you
Sohail Shaikh
Sohail Shaikh
girikas
Member
67 Points
321 Posts
Re: cc1:AsyncFileUpload stopped working updated panel??
Aug 09, 2012 09:36 AM|LINK
hi SohailShaikh,
i tried this also friend..but its not working...i cleared all the errors except one that is
.other an issue in this page is on FileUploadComplete(object sender, EventArgs e) event is completed then it show the image control in that web page.finish this process, i have a forum with submit separately in that web page.after complete filling the forum and click submit means,again it will fire the event FileUploadComplete(object sender, EventArgs e) and showing the error that image not yet selected...
defaultly calling the event FileUploadComplete(object sender, EventArgs e) ...how to fix this error?
guide me friends
SohailShaikh
Contributor
6119 Points
1167 Posts
Re: cc1:AsyncFileUpload stopped working updated panel??
Aug 09, 2012 09:41 AM|LINK
Ok Put this
code behind
protected void AsyncFileUpload1_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { image1.imageurl=""; }Mark as your answer if you think its help you
Sohail Shaikh
Sohail Shaikh