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

  • Home
  • SEARCH
  • 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 506475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:42:18+00:00 2026-05-13T06:42:18+00:00

Invalid expression term ‘<‘ <asp:TextBox ID=txtPassword runat=server Width=180px TextMode=Password OnTextChanged=CheckPasswordStrength(<%= txtPassword.ClientID.ToString() %>,<%= lblMessage.ClientID.ToString() %>)/>

  • 0

Invalid expression term ‘<‘

<asp:TextBox ID="txtPassword" runat="server" 
            Width="180px" TextMode="Password" 
            OnTextChanged="CheckPasswordStrength(<%= txtPassword.ClientID.ToString() %>,<%= lblMessage.ClientID.ToString() %>)"/>

If i writes this code like the following then error occurs An unhandled exception has occured. Server tags cannot contain <% %> constructs

  <asp:TextBox ID="txtPassword" runat="server" 
                Width="180px" TextMode="Password" 
                OnTextChanged="CheckPasswordStrength("<%= txtPassword.ClientID.ToString() %>","<%= lblMessage.ClientID.ToString() %>")"/>

When I m using this code at .cs file then every thing is working fine.

 protected void Page_Load(object sender, EventArgs e)
    {
        txtPassword.Attributes.Add("onKeyUp", "PasswordCheck("+txtPassword.ClientID.ToString()+")");
        txtPrimaryEmail.Attributes.Add("onKeyUp", "EmailChecker("+txtPrimaryEmail.ClientID.ToString()+")");
    }
  • 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-13T06:42:19+00:00Added an answer on May 13, 2026 at 6:42 am

    There are a couple things going on with this.. You can’t include parameters in your server-side event, and you can’t use <%= in a server control.

    Are you meaning to fire a JavaScript event?

    If you’re meaning to fire a JavaScript event, do one of three things:

    1) Use a databinding expression (<%# Control.ClientID %>) – This requires that somewhere within the life-cycle DataBind() is being called on your control.

    2) Assign the event in the code-behind, using Control.Attributes.Add(“javascriptevent”, “DoStuff(x, y)”)

    3) You can use <%= %> in your client script, e.g.

    function MyJavaScriptEventHandler()
    {
       var textbox = document.getElementById('<%= MyASPTextBox.ClientID %>');
       alert(textbox.value);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

String s = new String({'h','e','l','l','o'}); I received the error: 1 Invalid expression term '{'
I'm getting Invalid expression term : error if I use <%:%> with VWD2010 Express,
I'm getting the error Invalid expression term else . Also an error by the
<%# Convert.ToDateTime(Eval(Posted)).ToShortDateString() %> It tells me Invalid Expression term ')' . The code still
I am using regular expression to filter the invalid input entered by the end
I'd like to accomplish what this (invalid I believe) regular expression tries to do:
In C++0x SFINAE rules have been simplified such that any invalid expression or type
After self.currentProperty = [NSMutableString string] I saw invalid expression on that thing on the
I am getting this error, Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: Invalid expression . Searched in internet
Invalid octal digit error in Ruby, how do I by pass that? I have

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.