[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Auto-submit a form in C#

Posted on 2008-06-26
3
Medium Priority
?
1,733 Views
Last Modified: 2013-12-16
Hi,

I have a form with some hidden fields and I wish to auto-submit this in the Page_Load event in the codebehind file (C#), if certain conditions are met, without using a submit button.

For example, if the user's name is "ABC", the form should automatically submit. It then takes him to a different application, using the values of the hidden fields.

Please help.

- A

0
Comment
Question by:arunatata
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Expert Comment

by:Anurag Agarwal
ID: 21881078
You can acheive this in 2 ways
On page load if certain conditions are met then redirect the user to whereever you want using response.redirect.

Or

On page load if conditions are met then explicitly call the btnSubmit_click event from there only. All the code will get executed that is writtren in that function.

Anurag
0
 

Author Comment

by:arunatata
ID: 21885922
The form's method is "POST" - the variables are going to an external site. How can I submit this data with response.redirect?
0
 
LVL 11

Accepted Solution

by:
Anurag Agarwal earned 2000 total points
ID: 21889424
I was not aware that you are looking for this :-)

Here is the link of one good article from one of my faviourite sites to solve your problem
http://www.codeproject.com/KB/aspnet/jsnopostback.aspx

I hope this will work for you

Anurag

0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question