Rank: Newbie
Groups: Member
Joined: 1/19/2010(UTC) Posts: 5
|
For some reason, we are losing the querystring value when we click on the send button to upload the images. We are using ASP.NET and we are not saving cookies. How are we able to keep a value from a querystring?
|
|
|
|
Rank: Advanced Member
Groups: Joined: 3/9/2008(UTC) Posts: 554
Was thanked: 1 time(s) in 1 post(s)
|
Hello,
Could you please describe a bit detailed that is the querystring and how do you use it?
|
|
|
|
|
Rank: Newbie
Groups: Member
Joined: 1/19/2010(UTC) Posts: 5
|
okay this is how I have my code
Dim str as String Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load str=request.querystring("id") ' <<<<< str gets a value on page load no problem. end sub
Protected Sub ImageUploader1_FileUploaded(ByVal sender As Object, ByVal e As FileUploadEventArgs) Dim tmp as String tmp=str ' <<<<< it's gone here when I hit the send button on the imageupload end Sub
|
|
|
|
Rank: Advanced Member
Groups: Joined: 3/9/2008(UTC) Posts: 554
Was thanked: 1 time(s) in 1 post(s)
|
Hi, Thank you for the code. To resolve your problem I recommend you to send "id" value in POST-request along with uploaded files. You can do it using AddField method of Image Uploader. Your code should look in following way: Clent-side code:Code:Dim str as String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
str=request.querystring("id") ' <<<<< str gets a value on page load no problem.
end sub
... other code
<script type="text/javascript">
function Before_Upload()
{
getImageUploader("<%=ImageUploader1.ClientID%>").AddField("id", str);
}
</script>
<cc1:ImageUploader ID="ImageUploader1" runat="server" Height="449px"
width="768px"
UploadThumbnail1FitMode="Fit"
UploadThumbnail1Width="120"
UploadThumbnail1Height="120"
OnFileUploaded="ImageUploader1_FileUploaded"
OnClientBeforeUpload="Before_Upload" />
Server-side code:Code:Protected Sub ImageUploader1_FileUploaded(ByVal sender As Object, ByVal e As FileUploadEventArgs)
Dim tmp as String
tmp = Request.Form("id")
end Sub
If you have any questions feel free to let us know. Edited by user Wednesday, January 20, 2010 9:51:26 PM(UTC)
| Reason: Not specified |
|
|
|
|
Rank: Newbie
Groups: Member
Joined: 1/19/2010(UTC) Posts: 5
|
I have tried it as you suggested above, I got this error when I hit “Send” button “Error:’str’ undefined? I am using IE.
|
|
|
|
Rank: Advanced Member
Groups: Joined: 3/9/2008(UTC) Posts: 554
Was thanked: 1 time(s) in 1 post(s)
|
Sorry, It is my fault. Just correct the code as follows: Code:function Before_Upload()
{
getImageUploader("<%=ImageUploader1.ClientID%>").AddField("id", "<%=str%>");
}
Now it should work correctly. |
|
|
|
|
Rank: Newbie
Groups: Member
Joined: 1/22/2010(UTC) Posts: 1
|
Compiler Error Message: BC30455: Argument not specified for parameter 'Number' of 'Public Function Str(Number As Object) As String'.
Source Error:
Line 31: function Before_Upload() Line 32: { Line 33: getImageUploader("<%=ImageUploader1.ClientID%>").AddField("id", "<%=str %>"); Line 34: } Line 35: </script>
|
|
|
|
Rank: Advanced Member
Groups: Joined: 3/9/2008(UTC) Posts: 554
Was thanked: 1 time(s) in 1 post(s)
|
Hi, I recommend you to debug your code, it seems that you have some mistakes in your code. I recommend you to read the following articles: |
|
|
|
|
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.