Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5942825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:18:29+00:00 2026-05-22T16:18:29+00:00

When injecting a div server-side from ASP.NET (using .Visible), is it possible that my

  • 0

When injecting a div server-side from ASP.NET (using .Visible), is it possible that my pages are occasionally being redirected by the server before the javascript in the injected div block finishes executing? If so, how can I prevent a server-side redirect from occurring before my client-side code is done running?

Specifics of my issue:

I needed a quick solution to conditionally track google conversions on ASP.NET pages right before a redirect. I ended up creating an invisible div for each conversion, and when the submit button was clicked, the correct div block would be made visible from the code-behind, and then the rest of the code would process. A redirect is occasionally only a few lines of code away.

After a few weeks of monitoring the numbers, some aren’t adding up properly. For example, on a page that cannot be accessed without a previous conversion happening, I’m getting more conversion on the inner page than the outer (which should not be possible). To make sure this div code was executing every time a submit button was clicked, I added a javascript alert as the last line and it did pop up for me every single time. Even after this testing, though, the only logical explanation I can come up with is that the redirect is occurring before the client-side javascript code fully executes. Since the redirect is happening server-side, these run independently of each other.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:18:30+00:00Added an answer on May 22, 2026 at 4:18 pm

    This will be extremely unreliable. Most likely the tracking is loading an external script or img. As soon as the redirect begins all active requests from the current page are aborted.

    If you must track when the user leaves the page I would try some sort of intermediate tracking landing page, or actually encompass all of the tracking code in the submit client function.

    In the latter you would have to load the script/image and only process the submit once the onload callback fires.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sharebox(div containing social site links) that I've been using with a
I am using RequiredFieldValidator in my asp.net program. I have a sign out button
I am trying to create a simple ajax chat using JQuery and ASP.NET. My
Here is my DataList: <asp:DataList id=DataList Visible=false RepeatDirection=Horizontal Width=100% HorizontalAlign=Justify RepeatLayout=Flow runat=server> [Contents Removed]
A common problem that I have with web pages is floating div tags creeping
Is there a way to prevent Castle Windsor from automatically injecting dependencies into properties
I'm using a div with the contentEditable attribute to meet my need as a
I'm pulling some info from a database then putting it into a DIV and
I have small page which has label, DropDownList and a submit button. <div> <asp:label
Here's my problem: I have a selectable grid of div's that are tied to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.