Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Wednesday, March 28, 2012

Updated control KIT

I downloadedhttp://atlas.asp.net/default.aspx?tabid=47 this tool kit and I copied .dll file to my existing Atlas project and I still dont see new control like (dropshadow, roundcorners,modalpopup etc)
How to fix it?

Even when I create new application using atlast template I dont see new controls?

What dll did you copy?

It could be that you've reinstalled Atlas ... not the Atllas Control Toolkit , they are different.


I downloaded the new tool kit and than extracted and copied the bin folder from sample project to my project.

If this is wrong download what I need to dowload and from where? (Note: I already have old atlas running on my current project)


The atlas assembly is: Microsoft.Web.Atlas.dll ... no update since April 6.

The latest control toolkit is: AtlasControlToolkit.dll ... and some of the samples need Microsoft.AtlasControlExtender.dll as well (like the Modal dialog sample).

Have you tried running the sample website that comes with the toolkit? If not, you should try ... it has working examples of all of the controls.

If it's a pre-existing project, you'll also need to add a new directive to your pages in order to start referencing the toolkit controls.

<%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %
Hope I'm not repeating myself ... but the toolkit controls are open source samples of things that you can build on top of Atlas. I don't work for Microsoft ... so know idea if these things will be rolled into the core Atlas at somepoint. But at this point the goal is clearly to seed the developer community with cool things that you can do on top of the Atlas framework, get developers to submit new controls, etc.


Monday, March 26, 2012

UpdatePanel & Form View in Web Site Project vs. Web Application Project

I am seeing two different behavour patters when using the UpdatePanel in a Web Application Project (File > Add New Project > ASP.NET AJAX-Enabled Web Application) vs a Web Site Project (File > New Website > ASP.NET AJAX-Enabled Web Site)

The exact same code will complie in one project type but not in another.

The code is:

<

asp:FormViewID="FormView1"runat="server"> <EditItemTemplate> <asp:UpdatePanelID="UpdatePanel1"runat="server"> <ContentTemplate> <asp:LabelID="Label1"runat="server"Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> </EditItemTemplate> <InsertItemTemplate> <asp:UpdatePanelID="UpdatePanel1"runat="server"> <ContentTemplate> <asp:LabelID="Label1"runat="server"Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> </InsertItemTemplate></asp:FormView>If you have this code in a single page Web Application Project it will complie and run just fine. However if you have this code in a Web Site Project it will not complete. It complains that you have already declared Label1 in this class. SInce Label1 is inside two different FormView templates this should complie.

Does anyone know a resolution for this other than converting to using Web Application Projects instead of Web Site Projects?

Thanks In Advance
Martin

p.s. Using most recient System.Web.Extensions downalod (1.0.61025.0)

Nevermind. The Web Application Project does not complete the aspx file so it does not fail until you try to run the code.

I guess its another issue as to why the UpdatePanel forces you to rename your controls differently within each template of the formview control.

Martin

UpdatePanel + FileUpload + PostBackTrigger doesnt seem to work

As the title of the thread states, I have a file upload control inside an update panel and added a postbacktrigger to activate a full post back when the submit button is pressed but everytime I try and upload a file the HasFile property never equals true even though I know I chose a file with the file upload control. Am I missing something essential? Here is a snippet of the code..

1<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true">2 <ContentTemplate>34 ...5 ...6 ...78 </ContentTemplate>910 <Triggers>11 <asp:PostBackTrigger ControlID="PropertyValueSubmitButton" />12 </Triggers>1314</asp:UpdatePanel>

Hi There,

As what i can see, your code seem to be alright.

I even run a test base on your scenaria.

<asp:UpdatePanelID="UpdatePanel1"runat="server"ChildrenAsTriggers="true">

<ContentTemplate>

<asp:FileUploadID="FileUpload1"runat="server"/>

<asp:ButtonID="btnPostBack"runat="server"Text="My PostBack Button"OnClick="btnPostBack_Click"/>

</ContentTemplate>

<Triggers>

<asp:PostBackTriggerControlID="btnPostBack"/>

</Triggers>

</asp:UpdatePanel>

In code behind, i set a break point and test the value is true when i select a file and post it by click on the button

protectedvoid btnPostBack_Click(object sender,EventArgs e)

{

Boolean b = FileUpload1.HasFile;

}


Hi kbeeveer46,

Has your problem been resolved yet? If yes , sharing your work will be greatly appreciated!


Hi did you find a solution to your problem. I experience the same problem.

/Frederik


Hi,

I trying the exakt same thing with an AsynPostBackTrigger and then the FileUpload1.HasFile returns false. Do you know why this is so. What am I doing wrong.


I ran into almost exactly the same problem, although mine was a little more difficult because my File Upload control was in a dynamically loaded User Control and couldn't be moved outside of the Update Panel. I set the PostBackTrigger so that everything inside the userconrol would post back. I ran into the same problem that the .HasFile value was always false/null on the first page load. If I posted the page back with any button, then the upload control would work.

I had another AJAX application that was set up almost identical and it was working fine after setting the postbacktrigger. I started looking for differences, and in my default.aspx in the working app I found the following directive on the Form statement:

enctype="multipart/form-data"

Looks like this:

<formid="Form1"method="post"enctype="multipart/form-data"runat="server">

I'm not sure why I ever put it there, and I read on another post where this shouldn't matter, but guess what... I put that in my default.aspx and tried the non-working app again, and viola. Working like a charm.


I never did find a solution but I will definitely try out what hartmacw has said.

EDIT: hartmacw's solution worked perfectly. Thanks.

UpdatePanel + Scriptmanger and Respone.Redirect to (external time consuming ressource)

Hello,

As the title of my post suggest, i use Response.Redirect(http://..../download.ahsx) on submit of my form;

This works fine. The file is streamed to the users browser and my update panel displays the " loading data gif".

The problem is that when the external page returns, we are not notified of this and we keep displaying the "loading data gif".

Is there a client side event i should process to refresh the starting page?

Thanks

/kadji

Is Ajax of any help in such of situation at all?

Thanks

/Kadji


Hi,

I'm afraid AJAX cann't do this.

As you said, when the external page returns, the starting page is not notified keep displaying the "loading data gif".

I suggest you use a timer to hide the "loading data gif" manually.

Best Regards


You are correct.

Thanks

/Kadji


But then what would i be looking for in my timer tick?

My web application still has no idea of what is happening in my remote resource.

Any suggestion?

/Kadji


Sorry,I mean javascript timer,not AJAX timer.

More information,seehttp://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/

Best Regards


Hi Jin-Yu Yin,

Could you explain how a client side timer would let me know that my http handler has finished running?

Thanks

/Kadji

Saturday, March 24, 2012

Updatepanel and fileupload

hi !

in a webpage i use a fileupload wich is used to upload a xls file, and do some stuff on it and write some text in a label to say if it works

everything works fine

I tried to put the fileupload, button and a trace label in an updatepanel but i got a problem :

when i hit the button and debug the sub i see that the fileupload.hasfile is always False !

can you help me ??

without a full postback you won't be able to send the file to the server.


thanx for the reply, is there no way to use ajax technologie to post the file ?

do you thing it will be possible in the futur ?


Thanx


thanx for the reply, is there a way to use ajax technologie to post the file ?

do you thing it will be possible in the futur ?


Thanx