[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

moving asp.net postback javascript

Posted on 2005-04-25
9
Medium Priority
?
526 Views
Last Modified: 2012-05-05
Hi,

I'd like to know whether it's possible to shift the automatically inserted __doPostBack javascript function in ASP.net pages to the bottom of the page. Reason for doing this is obviously search engine optimisation. Does anyone know how to achieve this?

Thanks in advance
0
Comment
Question by:ralbion
  • 3
  • 3
6 Comments
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 13857163
Hai,

The answer is yes. It's no matter where it's

Bye
Ajai
0
 
LVL 11

Accepted Solution

by:
ajaikumarr earned 400 total points
ID: 13857172
Hai,

Check this it might help you to hijack __dopostback.

http://weblogs.asp.net/vga/archive/2004/03/01/NoMoreHijackingOfDoPostBackInWhidbey.aspx

Bye
Ajai
0
 

Author Comment

by:ralbion
ID: 13857193
Hi,

I know it doesn't matter where it is, but the question is how to move it!

I'll check out the link....

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ralbion
ID: 13857212
Ok, that's a useful link, but it's not really what I'm after. I want to physically move the script down to the bottom of the page code.
0
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 13857257
Hai,

Open the aspx on HTML Source view and paste the following lines on bottom of the page. Replace form names on necessary location.

<script language="javascript">
<!--
      function __doPostBack(eventTarget, eventArgument) {
            var theform;
            if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
                  theform = document.forms["Form1"];
            }
            else {
                  theform = document.Form1;
            }
            theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
            theform.__EVENTARGUMENT.value = eventArgument;
            theform.submit();
      }
// -->
</script>

Bye
Ajai
0
 

Author Comment

by:ralbion
ID: 13857296
Ok, but that now gives me 2 identical sections of code, 1 at the top and 1 at the bottom! How can I prevent the automated insertion of the top copy?
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

872 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