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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:13:33+00:00 2026-06-13T05:13:33+00:00

if (Request[__EVENTARGUMENT] != null && Request[__EVENTARGUMENT] == txt2OnClick) { txt2_Click(); } txt2.Attributes.Add(onclick, this.Page.ClientScript.GetPostBackEventReference(txt2, txt2OnClick));

  • 0
 if (Request["__EVENTARGUMENT"] != null && Request["__EVENTARGUMENT"] == "txt2OnClick")
        {
            txt2_Click();
        }  

 txt2.Attributes.Add("onclick", this.Page.ClientScript.GetPostBackEventReference(txt2, "txt2OnClick")); //within page load 

private void txt2_Click()
    {
        ImageMap1.ImageUrl = "guide/2.jpg";
    }

This is a perfect piece of code to have a click event on textbox, with asp.net (C#).
But the only problem is, we cant type when we apply this code to a textbox. So what I did was set the focus txt2.Focus(); then I can type, but the textbox is not getting validated (I have added a regular expression validator) . Any help? Even to have a better onClick event for a textbox than this?

  • 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-13T05:13:34+00:00Added an answer on June 13, 2026 at 5:13 am

    I don’t see any point in having click event for text box.. Remove your ‘perfect piece of code’ and txt2 if not required..If you have added regular expression validator correctly, it will take care of validation..

    EDIT:

    For changing some text or showing some image, you don’t need to post back to server..

    You can either use javascript Focus event or jquery to do that..

    In the link you provided, all those photos and texts are placed on divs and are already loaded on browser and when textbox gets focus, those div styles are just toggled between none and block..

    Something like this(jsFiddle)..

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

Sidebar

Related Questions

I saw code like this: if (this.Request[__EVENTARGUMENT] == Flag) //DoSomthing... What does __EVENTARGUMENT mean
request.fullpath gives the fullpath plus any parameter passed, such as /page?param1=value&param2&value How can I
I request a web page that sends a Content-Encoding: gzip header, but got stuck
This request caused a new process to be started for your application, and thus
request = GET /solr1/select?q=reqRelDate_l%3A%5B1321516800000+TO+1321775940000%5D+AND+requestStatus_s%3ASUB29&wt=javabin&version=1 HTTP/1.1 or request = GET /solr1/select?q=reqRelDate_l%3A%5B1321516800000+TO+1321775940000%5D+AND+requestStatus_s%3ASUB29&wt=javabin&version=1 HTTP/1.1 And I want
I need some help with setting up a cURL request to a page. In
request.open(GET, selectedTab + .html, true); Will this respond me back with the whole html
I'm stuck! I understand the page lifecycle and how i need to add the
Request.Url Full URL : http://localhost:2000/virtual_dir/myrep/page.aspx?q=qvalue i know how to get ?q=qvalue using Request.Url.Query but
Request[key] vs Request.Params[key] vs Request.QueryString[key] Which method do you seasoned programmers use? and why?

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.