Solved

avoid javascript-doPostBack() in asp.net

Posted on 2011-09-26
7
368 Views
Last Modified: 2012-06-21
HOw to avoid a java script:do postback when click ing any link on a asp.net web site.
Urgent solution required.
0
Comment
Question by:Ammar Iqbal
[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
7 Comments
 
LVL 55

Expert Comment

by:Huseyin KAHRAMAN
ID: 36645417
post some code...
0
 
LVL 55

Expert Comment

by:Huseyin KAHRAMAN
ID: 36645488
use regular html element, for example:

<a href="..."><img src="..."></a>
0
 
LVL 55

Expert Comment

by:Huseyin KAHRAMAN
ID: 36645790
or a button with js

<button onClick="someJSFunction()">Do something</button>
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 1

Author Comment

by:Ammar Iqbal
ID: 36703696
I am using  as

Protected Sub LinkButton15_Click(ByVal sender As Object, ByVal e AS EventArgs) Handles LnikButton15.Click
  Response.Redirect("Seminae_Forside.aspx")
End Sub

this is one libk. When I bring mouse over the menu, ("Seminae_Forside.aspx) to traverse this link, i get  "javascript-doPostBack():ctlButtonLinkButton14". and it is taking much ,much time to do so.

How to solve his?
Urgently need help

0
 
LVL 17

Accepted Solution

by:
sonawanekiran earned 500 total points
ID: 36707540
1) Add attributes to link in page_load method
  LinkButton15.Attributes.Add("onClick", "return DonotPostback();")

2) Add below script in head tag
<script>
function DonotPostback()
{
   return false;
}
<script>
0
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 36707746
Hi,
If you using link button, use following code;

<asp:LinkButton id="LinkButton15" Text="Submit"
  PostBackUrl="Seminae_Forside.aspx" runat="Server" />

Regards,
Ram
0
 
LVL 55

Expert Comment

by:Huseyin KAHRAMAN
ID: 36710711
make it simple, use a link instead

<a href="Seminae_Forside.aspx">Forside</a>

and remove all the code...
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

688 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