ajaxfileupload querystring missing asp.net - asp.net

I'm using the Ajaxfileupload to upload files and store it in the DB.
The record is coming from an Id specificed in the querystring.
(page.aspx?ID=10)
Unfortunately when the UploadComplete even fires up, it does a postback and removes my ID and use other variables.
Any Ideas how to overcome it?
I tried to pass the ID through a Form or as a Property but to no avail.
I came across this post http://ajaxcontroltoolkit.codeplex.com/workitem/27149 but I can't figure out where is the AjaxFileUpload.pre.js file and how do I override it.
Any help would be appreciated.
Thanks
Oren

I realise that this is an old question but it hasn't been answered so I will just incase you did not resolve it or it helps someone else.
You will need to download the ajaxcontroltoolkit source code at https://ajaxcontroltoolkit.codeplex.com/SourceControl/latest# and open it in visual studio.
The file that you are looking for is at :-
Server --> AjaxControlToolkit -->AjaxFileUpload --> AjaxFileUpload.Control.pre.js
Make the changes as described in the link you gave, rebuild the solution to get an updated AjaxControlToolKit.dll file to put into your website bin folder replacing the old one.
That should solve your issues :)

Related

Spam in email form using .aspx language C# - how to add CAPTCHA

---- Final Solution ----
Since I am not familiar with asp - I decided to go with a jquery captcha ( thanks for all your help )
Edit New
I am using the reCaptcha with ASP.NET doc's found here:
https://developers.google.com/recaptcha/docs/aspnet
Okay I added the code the the page see screen shot here.
http://qualityplanners.com/1.png
I am now getting this error.
http://www.qualityplanners.com/freequotecs.aspx
The first step of the docs asks me to:
Download and Add Recaptcha.dll to the root.. how do I link it without visual studio?
Let me know
-O
Old Below
I need help with a client with aspx - I am only familiar with PHP.
He keeps getting spam with this old form the past web guy coded.
http://www.qualityplanners.com/freequotecs.aspx
I am looking into ways to add reCAPTCHA or an easy method to stop spam... even just adding a simple validation for whats 5+6 or something.
I tried looking into the documentation for reCAPTCHA or some other free online CAPTCHA scripts but keep getting error - I am probably installing it wrong.
Whats the correct way to do this?
This is the fiddle of the linked code.
http://dotnetfiddle.net/ROzRgl
Thanks in advance.
-O
I think you may have skipped step 1.
Add a reference on your website to library/bin/Release/Recaptcha.dll:
On the Visual Studio Website menu, choose Add Reference and then click
the .NET tab in the dialog box. Select the Recaptcha.dll component
from the list of .NET components and then click OK. If you don't see
the component, click the Browse tab and look for the assembly file on
your hard drive.

FileUpload.HasFile always remain false(I am using Ajax)

I am writing one simple page in APS.Net with VB.Net as the scripting language. In this page I have two text boxes and relevant buttons to complete the job of taking input from the user.
The form prompts the user to enter an image title, image to upload(using ASP AjaxControlToolkit FileUpload control) and a list of search tags to research this image in the future.
I have researched for more than three hours and tried many different solutions posted online but still I am not able to fix the FileUpload.HasFile = False problem. This condition always remains false even after choosing the file to upload.
I understand that many similar questions have already been posted but I have tried those solutions and still I could not fix it.
It would be really great if someone could please help me with this.
I am using MS SQL database but I haven't done anything related to database in this page as I am not done with the validation and the input yet.
Please download the code files from:
http://www.mediafire.com/?ae1jq33zkj50tt7,olcmd5yct3tz52m,7lm3a9syplfdec6
Please let me know if you need anything else.
What u need is here! Checkout this , you may get some help from here.
mark this as answer if u like it. :)

HTML formatting error on Umbraco workflow notification emails

I've posted this in the Our Umbraco forum (http://our.umbraco.org/forum/ourumb-dev-forum/bugs/30914-HTML-formatting-error-on-workflow-notification-emails) but would like to expand the audience as I need a quick resolution to this problem.
There appears to be an issue with the HTML used in workflow notification emails, property names are displayed but their values are not visible. The HTML content is there and if I save the source as an .htm file and view it in Firefox the values are displayed (although in the wrong location).
The HTML is generated from the sendNotification function in the umbraco.cms.businesslogic.workflow namespace, I am using Umbraco v4.7.1.1 and this problem was noticed in Outlook 2007.
Has anybody else encountered this problem?
It appears that this issue has been logged with Umbraco (http://umbraco.codeplex.com/workitem/26577) but has not been addressed.
The fix is a simple code change, for my current project I have decided to download the CMS source code and make the change myself. This works but throws up maintenance issues e.g. ensuring my change is not wiped out during a CMS upgrade.

AsyncFileUpload *VERY* broken in the AjaxControlToolkit

I've just downloaded the new AjaxControlToolkit from codeplex to give the much anticipated AsyncFileUpload control a go, but unfortunately it has fallen at the first hurdle...
I have put it on a fairly simple page called uploadFile.aspx which takes a url argument:
uploadFile.aspx?myDbId=1
In the page load, it's doing stuff with Request["myDbId"].
When selecting a file using the new control, it posts it back straight away, but it hits a 500 error with the Request["myDbId"] line because it has stripped ALL url arguments and replaced them for it's own:
uploadFile.aspx?AsyncFileUploadID=ctl00_BodyPlaceHolder_ctl00&rnd=08382490910589695
This to me is a massive problem, and one I haven't been able to get around. Any solutions?
Here's an alternate solution if that one doesn't work out. This solution has been around for a year or two, and it is his second version. It includes a progress bar that doesn't require a flash dependency, and can handle very large files without problems.
ASP.Net File Upload Module v2
http://darrenjohnstone.net/aspnet-file-uploaddownload-module-v2-documentation/
Can you use a Session variable to manage myDbId?
You could encode the id in the filename, so just append "--" + myDbId to the filename. The fact that it comes after the extension could make it easier to know that this was added.
Put the AsyncFileUpload control in an iframe on the page, which will post back to just that section.

Urlrewriting.net pages are not causing postbacks

I'm using webforms with UrlRewriting.Net to rewrite pages, e.g.
http://www.example.com/stuff.aspx?c=30
becomes
http://www.example.com/stuff/30-this-stuff.aspx.
It works in so far as the correct content is loading; however, none of the postbacks are working (mostly buttons on the page). If I set up a breakpoint on Page_Load, I see that IsPostBack is always false. Any ideas on how to fix this? Right now I'm just on Visual Studio 2008.
EDIT:
I have since switched to UrlRewriter.Net, which worked after a few tweaks (see Scott Gu's article). Besides here, I have posted my original problem to the developer's forum: if I ever get an answer, I'll post it here (unless else posts it here first).
You need to make sure it is doing something called ClientRebaseing which makes sure .NET is seeing the new URL vs the old Raw URL. See this post for more information:
http://www.ifinity.com.au/Blog/Technical_Blog/EntryId/46/Why-does-Url-Rewriting-break-all-my-image-links
Also I don't know if this is supported in UrlRewriting.NET, but my own URL Rewriter based off of Apache mod_rewrite does support rebasing the client path.
http://urlrewriter.codeplex.com
I could be way off here, but I worked on a project that used UrlRewriter.Net and from what I remember, I think the issue you're having is not rewriting the form element's action attribute. View your source and see if the URL in <form action"..." ... /> is the same as what's in your address bar. I don't know how we did this because it was at another job and the technical lead there wrote the code to do that, but I imagine you would change the rendering of the form tag.

Resources