How to use with "src="

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use with "src="

Guest-20

Hi,

I dont use nor have VS.net, but as far as I know I can make Framework compile at runtime without the need to recompile with VS.

I tried to replace "codebehind=" with "src=" but can't manage to make the modified demo.aspx and demo.aspx.cs sucessfuly moveto() or copyto() the temp file.

Can you help, please. (I'm not a programmer)

Thank's

Reply | Threaded
Open this post in threaded view
|

Re: How to use with "src="

Dean Brettle
Administrator
Try the following:

1. Copy Demo.aspx.cs to Demo2.aspx.cs.
2. Change "class Demo" to "class Demo2" in Demo2.aspx.cs.
3. In Demo.aspx, change:
<%@ Page language="c#" Codebehind="Demo.aspx.cs" AutoEventWireup="false" Inherits="Brettle.Web.NeatUpload.Demo" %>

to (changes in bold):

<%@ Page language="c#" Src="Demo2.aspx.cs" AutoEventWireup="false" Inherits="Brettle.Web.NeatUpload.Demo2" %>

Note that you must change the value of the Inherits attribute too.

To test, point your browser at http://hostname/Demo.aspx

To modify Demo2.aspx.cs to save the uploaded file in a file called "test" in your system temp directory, add the following bold line to Demo2.aspx.cs:

                private void Page_PreRender(object sender, EventArgs e)
                {
                        if (this.IsPostBack)
                        {
                                if (inputFile.TmpFile != null)
                                {
                                         inputFile.TmpFile.MoveTo(Path.GetTempPath(), "test");
                                        ...

If that doesn't work, you might be running into the same problem that someone else reported today, so you might want to read the following thread and try the suggestions therein:

http://www.brettle.com/ForumThreadView.aspx?thread=19&pageid=32&pageindex=7

--Dean


Reply | Threaded
Open this post in threaded view
|

Thank's

Guest-20

I'll give it a try...

Thank-you very much!