Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
corlin  
#1 Posted : Wednesday, January 13, 2010 12:57:48 PM(UTC)
corlin

Rank: Newbie

Groups: Member
Joined: 1/9/2010(UTC)
Posts: 7

Hi,

I am trying to use the imageuploader toplace some images in a database on my server.

So in the FileUploaded event i place my code to save the image to my db. This works fine - but now i want to have the user add some extra info in textboxes needed for my db save.

But in the FileUploaded event the txtBoxes always appear empty?

here is some snippets:

from the asp page
Quote:

<asp:TextBox ID="txtCaseID" runat="server" CausesValidation="True"></asp:TextBox>

<cc1:ImageUploader ID="ImageUploader1" runat="server" Height="449px"
width="768px"

RedirectUrl="MyUploads.aspx"
UploadThumbnail1FitMode="Fit"
UploadThumbnail1Width="120"
UploadThumbnail1Height="120"
OnFileUploaded="FileUploaded" />




c# codebehind
Quote:

protected void FileUploaded(object sender, Aurigma.ImageUploader.FileUploadEventArgs e)
{

if (txtCaseID.Text.Length > 0)
{...dosql stuff..}
}


The txtCaseID is always empty when I enter the FileUpload event - whats the catch here??

Tamila  
#2 Posted : Thursday, January 14, 2010 2:29:18 AM(UTC)
Tamila

Rank: Advanced Member

Groups:
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)
Hello,

To resolve your problem you need to modify your code. To get the length of txtCaseID value you need to send it from client-side to server using Image Uploader method AddField in following way:
Client-side:
Code:
<asp:TextBox ID="txtCaseID" runat="server" CausesValidation="True"></asp:TextBox>

<script type="text/javascript">
	function Before_Upload()
	{
		getImageUploader("<%=ImageUploader1.ClientID%>").AddField("txtCaseID", document.getElementById("<%=txtCaseID.ClientID%>").value);
	}
</script>

<cc1:ImageUploader ID="ImageUploader1" runat="server" Height="449px"
width="768px"

RedirectUrl="MyUploads.aspx"
UploadThumbnail1FitMode="Fit"
UploadThumbnail1Width="120"
UploadThumbnail1Height="120"
OnFileUploaded="FileUploaded" 
OnClientBeforeUpload="Before_Upload" />


Server-side:
Code:
protected void FileUploaded(object sender, Aurigma.ImageUploader.FileUploadEventArgs e)
{
	int tCaseID = Request.Form["txtCaseID"].Length;
	if (tCaseID > 0)
	{
		//...dosql stuff..
	}
}


I hope it helps you.
Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!
corlin  
#3 Posted : Wednesday, January 20, 2010 1:56:37 AM(UTC)
corlin

Rank: Newbie

Groups: Member
Joined: 1/9/2010(UTC)
Posts: 7

Hi again,

that really helped :d/
Users browsing this topic
Similar Topics
Updating other controls from FileUploaded Event in ASP.net (Discussions – HTML5/Flash Uploader)
by chart 3/29/2016 10:15:15 AM(UTC)
Forum Jump  
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.