• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

avoid javascript-doPostBack() in asp.net

HOw to avoid a java script:do postback when click ing any link on a asp.net web site.
Urgent solution required.
Ammar Iqbal
Ammar Iqbal
1 Solution
HainKurtSr. System AnalystCommented:
post some code...
HainKurtSr. System AnalystCommented:
use regular html element, for example:

<a href="..."><img src="..."></a>
HainKurtSr. System AnalystCommented:
or a button with js

<button onClick="someJSFunction()">Do something</button>
7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Ammar IqbalSenior IT Consultant/senior Software engineerAuthor Commented:
I am using  as

Protected Sub LinkButton15_Click(ByVal sender As Object, ByVal e AS EventArgs) Handles LnikButton15.Click
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

Kiran SonawaneProject LeadCommented:
1) Add attributes to link in page_load method
  LinkButton15.Attributes.Add("onClick", "return DonotPostback();")

2) Add below script in head tag
function DonotPostback()
   return false;
Ramkisan JagtapLead DeveloperCommented:
If you using link button, use following code;

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

HainKurtSr. System AnalystCommented:
make it simple, use a link instead

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

and remove all the code...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now