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 6990203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:18:59+00:00 2026-05-27T19:18:59+00:00

How would I call this jquery function from my code behind page. Im clueless

  • 0

How would I call this jquery function from my code behind page. Im clueless what the syntax would be. Any helo would be greatly apreciated. It pops a window for users to register. I want to pop the page once the user views 5 pages on the site. Im goign to hold that count in a session variable.

Html page

<ul>

<li><a href="#dialog" name="modal">Simple Window Modal</a></li>

</ul>
div id="dialog" class="window">

<a href="#"class="close">Close it</a>
<br /><br />
Register Now its quick and Easy.<br />
Rules: 

        1) Items with "*" are required fields to be filled out.
        <br />
    </p>
    <asp:Label ID="lblEmail" runat="server" Text="*Your Email: "></asp:Label><asp:TextBox
        ID="txtEmail" runat="server"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtEmail"
        ErrorMessage="You must enter your email address."></asp:RequiredFieldValidator>
    <br />
    <asp:Label ID="lblUserName" runat="server" Text="*Name: "></asp:Label>
    <asp:TextBox ID="txtName" runat="server" Width="157px"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtName"
        ErrorMessage="You must enter a username."></asp:RequiredFieldValidator>
    <br />
    <asp:Label ID="lblCity" runat="server" Text="*City: "></asp:Label>
    <asp:TextBox ID="txtCity" runat="server" Width="168px"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtCity"
        ErrorMessage="You must enter your location."></asp:RequiredFieldValidator>
    <br />
    <asp:Label ID="lblState" runat="server" Text=" State: "></asp:Label>
    <asp:TextBox ID="txtState" runat="server" Width="168px"></asp:TextBox><br />
    <asp:Label ID="lblAge" runat="server" Text="*Age: "></asp:Label>
    <asp:TextBox ID="txtAge" runat="server" Width="165px"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtAge"
        ErrorMessage="Please enter your age to continue."></asp:RequiredFieldValidator>
    <br />
    <asp:Label ID="lblSex" runat="server" Text="*Gender: "></asp:Label>
    <asp:RadioButton ID="rdMale" runat="server" GroupName="Gender" Text="Male" />
    <asp:RadioButton ID="rdFemale" runat="server" GroupName="Gender" Text="Female" />
    <asp:Label ID="RadialLBL" runat="server"></asp:Label>
    <br />
    <br />
    <asp:Label ID="lblYahoo" runat="server" Text="Yahoo ID: "></asp:Label>
    <asp:TextBox ID="YahooID" runat="server"></asp:TextBox>
    <br />
    <asp:Label ID="lblMSN" runat="server" Text="MSN ID: "></asp:Label>
    <asp:TextBox ID="MSNID" runat="server" Width="133px"></asp:TextBox>
    <br />
    <br />
    <asp:Label ID="lblMyspaceLink" runat="server" Text="Your Myspace Link: "></asp:Label>
    <asp:TextBox ID="MyspaceLink" runat="server" Width="255px"></asp:TextBox>
    <br />
    <asp:Label ID="lblFaceBookLink" runat="server" Text="Your FaceBook Link: "></asp:Label>
    <asp:TextBox ID="FaceBooklink" runat="server" Width="244px"></asp:TextBox>
    <br />
    <asp:Label ID="lblUploadpic" runat="server" Text="*Upload your picture."></asp:Label>
    <asp:FileUpload ID="FileUpload1" runat="server" Height="22px" Width="217px" /><br />
    <br />
    <asp:Label ID="Label1" runat="server"></asp:Label><br />
    <br />
    <asp:Label ID="lblDesctiption" runat="server" Text="*User Bio: "></asp:Label><br />
    <asp:TextBox ID="txtDescription" runat="server" MaxLength="240" Width="390px" Height="73px"
        Rows="3" TextMode="MultiLine"></asp:TextBox><br />
    <br />
    <asp:Button ID="btnRegister" runat="server" Text="Register" OnClick="btnRegister_Click" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtDescription"
        ErrorMessage="Enter a bio or description of yourself."></asp:RequiredFieldValidator>
    <br />
    <asp:Label ID="EnterAll" runat="server"></asp:Label>
    <asp:Label ID="Displayme" runat="server" Text=""></asp:Label>
    <br />
    <br />
</div>

Jquery function

<script>

$(document).ready(function () {

    //select all the a tag with name equal to modal
    $('a[name=modal]').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();

        //Get the A tag
        var id = $(this).attr('href');

        //Get the screen height and width
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();

        //Set heigth and width to mask to fill up the whole screen
        $('#mask').css({ 'width': maskWidth, 'height': maskHeight });

        //transition effect     
        $('#mask').fadeIn(1000);
        $('#mask').fadeTo("slow", 0.8);

        //Get the window height and width
        var winH = $(window).height();
        var winW = $(window).width();

        //Set the popup window to center
        $(id).css('top', winH / 2 - $(id).height() / 2);
        $(id).css('left', winW / 2 - $(id).width() / 2);

        //transition effect
        $(id).fadeIn(2000);

    });

    //if close button is clicked
    $('.window .close').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();

        $('#mask').hide();
        $('.window').hide();
    });

    //if mask is clicked
    $('#mask').click(function () {
        $(this).hide();
        $('.window').hide();
    });

});

  • 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-27T19:19:00+00:00Added an answer on May 27, 2026 at 7:19 pm

    Below is a sample snippet to register a script to the Response:

    if(Session["_PageVisitCount"].ToString() == "5"){
        Page.ClientScript.RegisterStartupScript(
            this.GetType(),
            "scriptsKey",
            "yourScriptMethodToCall();",
            true
        );
    }
    

    After further reviewing your code, there isn’t any client-side code that can be called explicitly. Are you missing any scripts?

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

Sidebar

Related Questions

Is there any way how to call JQuery function from PageLoad C# file? Basically
Is there an API function call for this board that would allow me to
Basically I want to be able to call jQuery from FireBug, place code that
I am using JavaScript and jQuery and would like to call a function when
Would you call this implementation of a multiton in objective-c 'elegant'? I have programmatically
I have a GUI program, which would call a cmd in this GUI program.
This is an objective-c question. I would like to call a method in an
I have this jQuery which adds a click event to the selected object (from
I am referencing JavaScript as follows on an HTML page: <script type=text/javascript src=http://code.jquery.com/jquery-1.6.1.min.js></script> <script
I would like to display a JSON response (from an ajax call) in a

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.