Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

disable auto postback event on button submit in asp.net

Posted on 2007-04-02
3
Medium Priority
?
3,362 Views
Last Modified: 2008-01-09
Hi currently I am using asp.net 2.0 and c# language and sql server 2005 as database server

On page load event I am retrieving values from db and displaying it on form text box.
On button click event I have made database connectivity and storing value of textbox in database.
But when I am doing edition in textbox and going to save those updates. Then it will show values in textbox without modification of contents.

When I am using asp.net button it will automatically take autopostback event true.
I have read somewhere that we can disable it using html button but.......
If I am using html button then .net and sql database connectivity is not working in it.
I just want to disable autopostback event......

Thanks in advance
0
Comment
Question by:dotsandcoms
[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
3 Comments
 
LVL 4

Expert Comment

by:coesy
ID: 18835507
But you need the postback in order to process your database stuff, the postback is what allows the onclick event of the button.
0
 
LVL 5

Expert Comment

by:jef06
ID: 18835510
try
button.attributes.add("onClick", "return false;");)
0
 
LVL 25

Accepted Solution

by:
dstanley9 earned 2000 total points
ID: 18836163
Is sounds like you just need to load the data on the first call, not on postback.  If so use this in Form_Load:

if(!IsPostBack)
{
  // load data
}
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This video teaches users how to migrate an existing Wordpress website to a new domain.

636 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