Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to stop page refresh on runtime dynamic button click

Posted on 2008-09-29
1
Medium Priority
?
617 Views
Last Modified: 2013-12-17
i have a dynamic(run time created) Button(creating on page load event),  but click on it causes page refresh,
I want no refresh,
any expert plz help
0
Comment
Question by:rajeev_23
[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
1 Comment
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 2000 total points
ID: 22596473
If you created a server button (System.Web.UI.WebControls.Button), there is no way to got it without postback. Server buttons cause postback always. Anyway, you can detect click on button in javascript and kill the postback from there; but depending on the browser you use, the method for doing this may be different.

But, most important, if you really don't need a postback, it will be much better that you create an HTML input button: no postback ensured.

So, instead of
Dim button As New System.Web.UI.WebControls.Button
do this
Dim button As New System.Web.UI.HtmlControls.HtmlInputButton

Good Luck!
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

715 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