I'm look for a way to pre-populate Asp.net form from E-mail Link. I tried several method such as:
http://www.test.com/ContactUs.aspx?CustID=123
http://www.test.com/ContactUs.aspx?ctl00$ctl00$MainContent$MainContent$CustID=123
http://www.test.com/ContactUs.aspx?ctl00_ctl00_MainContent_MainContent_CustID=123
Our vendor is saying this should work but I'm having no luck with it. If someone can tell me what might be wrong with this or if there is another solution. This is being used for an e-mail campaign so that the user receiving the e-mail does not have to fill the form link is navigating to.
Jamal
You need to add server-side code to populate the fields from the querystring.
Related
my question is more logical than practical. So I have notifications system and everytime a notification is clicked it reroutes me to a page where I should give feedback to a user.Example
I need the UserId inside my Feedback Page, this way I can add the new Feedback to that user.
So what I am asking is: How do I tackle this problem? Will ViewData[] solve my problem or is flawed this way.
Since you are rerouting to a new page, and want to pass in the user's ID, I believe you would be well off to use a Query String
From the link that takes you to the Feedback Page, you can use a URL like this:
https://example.com/feedback?userId=123456
or add it to however you are building your links
From the Feedback Page, you can then capture that query from the URL
I have two gravity forms on my website that pass the email parameter via query strings. However, an email is sent to the user after he/she submits form one. In that email, I would like to have the url with the query string there so that the user can click on it. Whenever I try to do this by appending the mergetag to the end of the url, it never functions.....I am doing something like this www.mywebsite.com/new_form_page/?email={mergetag_email}. Is there a proper way to get this done?
Thanks
So I found out the issue. Wordpress removes formatting so all I had to do was click the box next to disable formatting and it worked fine....
In the WebSite (ASP.NET Razor) that I'm doing, I have two PartialViews: Subscribe Newsletter and Contact Form. Each one of this forms has his own #model.
In the Contact Form (with 3 fields: Name, Email and Message), I want to put some validation, and if there are any errors, show it to the user.
The problem it's, when I get the error, I receive an error saying that I cannot deliver the ContactObject to the Newsletter form.
I know that I need to use jQuery and Ajax on this, but I have no clue how can I do this.
Someone can throw me a hand and send me a small example how can I do this with this two partial views?
NOTE: I don't want to create a super-object with both models.
Regards
Paulo Aboim Pinto
Odivelas - Portugal
Make each partial it's own html form submitting to their own actions. Then it will work as designed.
I want to write a DotNetNuke module that can take an HTML form and parse or transform it into an asp.net form that would then do a HTTPPost to the page specified in the HTML Form's action property.
We regularly run into the need to use pre-existing forms (from existing sites and Service Providers like Paypal and Constant Contact). Currently, we either use an IFrame, manually convert the form into an ASP.NET user control, or use a forms module to recreate the form. It seems like it should be fairly easy to create an automated way to handle these with ASP.NET.
My quick plan:
1.) Admin Users will paste the form into a settings page and then click a convert button
2.) The code will parse the HTML and generate a ascx User Control from it and store the posting address. We may just have to add runat="server" into each of the form controls
3.) The admin user will be able to specify a variety of response codes and corresponding messages. (i.e. 1 -> "Thank you for your Donation", 2-> "We were not able to process your request at this time due to ...")
Users would then fill out the form and hit submit. The system would get the names and values of all form controls and Silent Post that to the posting address and get the response code and then display the corresponding message.
Any thoughts or suggestions of the best way to do this? Are there any tools that already do this or would be helpful?
Thanks,
David O'Leary
An outside vendor did some html work for us, and I'm filling in the actual functionality. I have an issue that I need help with.
He created a simple html page that is opened as a modal pop-up. It contains a form with a few input fields and a submit button. On submitting, an email should be sent using info from the input fields.
I turned his simple html page into a simple aspx page, added runat=server to the form, and added the c# code inside script tags to create and send the email.
It technically works but has a big issue. After the information is submitted and the email is sent, the page (which is supposed to just be a modal pop-up type thing) gets reloaded, but it is now no longer a pop-up. It's reloaded as a standalone page.
So I'm trying to find out if there is a way to get the form to just execute those few lines of c# code on submission without reloading the form. I'm somewhat aware of cgi scripts, but from what I've read, that can be buggy with IIS and all. Plus I'd like to think I could get these few lines of code to run without creating a separate executable.
Any help is greatly appreciated.
If you don't want the page to reload after submission, you will need to use AJAX. that is alot more complicated. you would still need the submit.aspx, you cannot send email with javascript.
Code a redirect after the form submission, so instead of getting the same form back in the main document/page, you could get something like a blank page saying "Thanks for your submission!" or something of that nature.
Might be more simple to redirect the user to a result page using Respone.Redirect that displays some sort of "Your email has been sent" message, or even just redirect back to the base page.