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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:43:25+00:00 2026-06-03T00:43:25+00:00

I just have a query I have a string which contain all the below

  • 0

I just have a query I have a string which contain all the below function added to the string variable and i want to add this to a control for e.g textbox control. So how can i add this to a textbox control

string strTextBoxScripts = " onclick="Func1();" onKeypress="Func2();" ";
textbox.attributes.add(strTextBoxScripts);

  • 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-06-03T00:43:26+00:00Added an answer on June 3, 2026 at 12:43 am

    It looks like you’re trying to inject some text directly into the HTML that gets rendered for an ASP.NET TextBox Control.

    Try this instead:

     textbox.Attributes.Add("onclick", "Func1();");
     textbox.Attributes.Add("onKeypress", "Func2();");
    

    The ASP.NET Web Controls create a separation of concerns between the HTML that gets rendered by a control and all of the features and functionality that the ASP.NET TextBox control exposes to you as a programmer. Under the hood and invisible to you, when a user loads your ASP.NET Page it will execute the Render() function from the base Page class which will eventually call Render() on all the Controls on the page including your TextBox.

    Only within that Render() function do you get anything that looks like the HTML you might be expecting:

     <input id="ctl00_textbox" onclick="Func1();" onKeypress="Func2();" /> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following xpath query which seems to be working but I just
I have a feeling that this query is pretty easy to construct, I just
I have the following MySQL query, which produces the result I want: SELECT `l`.`status`,
I have a problem, i have a query that just simply displays the user
I have the following query. It works just fine but I need to pull
I have written a SQL query that works just fine, but am having a
I am just facing trouble to sort out the query I need. I have
I just have an XP machine, and i want to play around using CC.NET.
I want to make sure a file path set via query string does not
Suppose I have a given object of type IEnumerable<string> which is the return value

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.