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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:57:26+00:00 2026-05-31T21:57:26+00:00

I have a master page in which I have the following code. <head runat=server>

  • 0

I have a master page in which I have the following code.

<head runat="server">
    <link href="StyleSheet.css" rel="stylesheet" runat="server" type="text/css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
    <asp:contentplaceholder id="LocalScripts" runat="server"></asp:contentplaceholder>
</head>

<body id="body" runat="server">
    <form id="form1" runat="server" defaultbutton="SignOutLB">
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </form>
</body>

My content page has the following code.

<asp:Content ID="ScriptContent" ContentPlaceHolderID="localScripts" runat="server">
<script type="text/javascript">
    function suggest(inputString)
    {
        if(inputString.length == 0) 
        {
            $('#suggestions').fadeOut();
        } 
        else 
        {
            $('#AAATB').addClass('load');
            $.post("AutoSuggest.aspx?ST=" + inputString, function(data){
                if(data.length >0) 
                {
                    $('#suggestions').fadeIn();
                    $('#suggestionsList').html(data);
                    $('#AAATB').removeClass('load');
                }
            });
        }
    }

    function fill(thisValue) 
    {
        $('#AAATB').val(thisValue);
        setTimeout("$('#suggestions').fadeOut();", 600);
    }
</script>
</asp:Content>

And the ASP.NET code is as follows.

<asp:TextBox ID="AAATB" runat="server" Width="90px" MaxLength="6" onkeypress="return IsNumberKey(event)" CssClass="textboxStyle" ValidationGroup="projNoValGp" onkeyup="suggest(this.value);" onblur="fill();" />
<div class="suggestionsBox" id="suggestions" style="display: none;"> 
    <img src="Images/arrow.png" style="position: relative; top: -2px; left: 50px;" alt="" />
    <div class="suggestionList" id="suggestionsList"> &nbsp; </div>
</div>

My AutoSuggest.aspx has the following piece of code.(I have done this for testing. Once the functionality works, I will change this for retrieving data from the database.)

protected void Page_Load(object sender, EventArgs e)
{
    string[] arr = new string[] {
                        "1234",
                        "1111",
                        "1333",
    };
    for (int i = 0; i < 3; i++)
    {
        Response.Write("<li onClick=\"fill(\'" + arr[i] + "\');\">" + arr[i] + "</li>");
    }
}

This works up to the extent that the values “1234”, “1111”, “1333” are displayed. But when I choose one of these values it is not reflected in the textbox “AAATB”.

I would be grateful for all the help to solve this issue.

Thanks,
Carolina

  • 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-31T21:57:28+00:00Added an answer on May 31, 2026 at 9:57 pm

    I think I know. You use ‘#AATB” as selector for the textbox. However, this is a serverside-ID and will be rendered differently on the client.
    Try using this as your fill code:

    function fill(thisValue)
    {
        $('.textboxStyle').val(thisValue);           
        setTimeout("$('#suggestions').fadeOut();", 600);
    }  
    

    The idea is to use the css-class as selector for the textbox since this isn’t modified.

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

Sidebar

Related Questions

I have a master page which references a style in the following manner: <link
I have a user control which contains the following code: <form id=CurrencyForm method=post runat=server>
I have the following code in my aspx page: <asp:Button runat=server ID=myButton Text=hello />
I have a html page in which following master reset css is included. I'll
I have a Master Page which has an associated css file. On one of
I have a master page in my asp.net MVC project, which has code like
I have an updatepanel which doesn't work. My whole code: <%@ Page Language=C# MasterPageFile=~/Master.Master
So I have a master page in MVC that has the following code in
So I have a master page which has the following function '# Get and/or
I have a master page, and this master page has the following code <%@

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.