Welcome Guest Search | Active Topics | Sign In | Register

How to set AJAXUploader Attributes in code behind? Options
newbie
Posted: Friday, July 20, 2007 2:51:27 AM
Rank: Newbie
Groups: Member

Joined: 7/20/2007
Posts: 2
Hi,

I have added the AJAXUploader control in Visual Studio to a page in design view:


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AjaxUpload.aspx.cs" Inherits="AjaxUpload" %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>AJAXUploaded</title>
</head>
<body>
<form id="form1" runat="server">
<div><br />Essential Objects AJAX Upload</div>
<div>
<eo:ajaxuploader runat="server" id="AJAXUploader1"></eo:ajaxuploader>

</div>
</form>
</body>
</html>


If I hard code the attributes in the HTML source the AJAXUploader works fine e.g:

<eo:ajaxuploader runat="server" id="AJAXUploader1" TempFileLocation="D:\uploads\imageWebTemp" AutoPostBack="true"></eo:ajaxuploader>


But how can I set its attributes from the code behine file?
The code below doesn't work from the PageLoad.
Please could you provide example code.
Thanks


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using EO.Web;

public partial class AjaxUpload : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AJAXUploader AJAXUploader1 = new AJAXUploader();

AJAXUploader1.TempFileLocation = @"D:\uploads\imageWebTemp";
AJAXUploader1.AutoPostBack = true;

}
}
eo_support
Posted: Friday, July 20, 2007 6:21:40 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,095
You need to remove that this line:

AJAXUploader AJAXUploader1 = new AJAXUploader();


You don't need to create the control again. The pager compiler has already created it for you based on your .aspx file.

Thanks
newbie
Posted: Friday, July 20, 2007 7:48:42 AM
Rank: Newbie
Groups: Member

Joined: 7/20/2007
Posts: 2
Doh!

Thanks for the quick reply!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.