ASP.NET adding to database from usercontrol without using a postback.

Posted on 2005-05-17
Last Modified: 2012-08-13
I have a usercontrol loaded with code behind. That usercontrol collects data via input boxes, there is a save button that is used to send the data to the sequel server. Problem is that the user control unload when the postback happens. And I would rather have it that way but the update to the database doesn't happen because the button event wasn't fired because it unloaded. I need a solution that I can do this without postback if at all possible. I appreciate any help

The coding language I am us is
Question by:jon37325
    LVL 23

    Accepted Solution

    It seems you are adding a User Control dynamically but have troubles persisting it across postbacks. The postback is fundamental to passing information between the end-user and the server. The problem lies with you adding a dynamic User Control.

    By trying to do something, you are now attempting to re-write the ASP.NET methodology.

    Have your User Controls as static ones.

    Author Comment

    I was hoping for a simple and easy solution, this was the best of both. I thought using dynamic controls would be easier but with all of the viewstate problems and uncertainty of static is the best policy. Thankyou.

    So much for ASP.NET being dynamic.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video discusses moving either the default database or any database to a new volume.

    761 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now