Professional Web Applications Themes

asp.net page view - ASP.NET General

I developed an application that search a db. I have a search page that has textbox, command button, and label. when the user enter nothing in the textbox and hit the button, the label will display an error. How can I change the label text to nothing when the user enters something in the textbox or when the user use the back arrow to go back to the search form. thanks...

  1. #1

    Default asp.net page view

    I developed an application that search a db. I have a
    search page that has textbox, command button, and label.
    when the user enter nothing in the textbox and hit the
    button, the label will display an error. How can I change
    the label text to nothing when the user enters something
    in the textbox or when the user use the back arrow to go
    back to the search form.


    thanks

    ervin Guest

  2. #2

    Default Re: asp.net page view

    In your button click event put some code like this:

    If MyTextBox.Text.Length>0 Then MyLabel.Text=""

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net
    Developer for Hire


    "ervin" <com> wrote in message
    news:028901c36371$ab268af0$gbl... 


    Steve Guest

  3. #3

    Default Re: asp.net page view

    You might want to use JavaScript:
    in the TextBox1-OnFocus event you clear the Label

    "ervin" <com> wrote in message
    news:028901c36371$ab268af0$gbl... 


    MS Guest

  4. #4

    Default asp.net page view

    Hi,

    If you want to clear the label text while editing the
    textbox, you have to use Javascript (onchange) event for
    the textbox.
    Also call the same method from body onload, so that while
    clicking the back button that will be cleared.

    Please consider the label name is asp.net getenrated
    page..you can use the following lines...
    var controls = doent.getElementsByTagName('INPUT');
    for (var i=0; i<controls.length; i++)
    {
    if (controls[i].type=="text")
    {
    var qnty = controls[i].value;
    if(controls[i].name.substring(n,n)=="your text name")

    Let me know if you need help.

    regards
    Sreejumon[MVP]
    www.mstechzone.com
     
    change 
    Sreejumon[MVP] Guest

Similar Threads

  1. permanently changing a single page view to 2 page spread?
    By Cindy_G@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 5
    Last Post: June 9th, 11:34 AM
  2. how to view only first page of pdf
    By shashikala@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 1
    Last Post: August 4th, 11:25 AM
  3. Cannot view ColdFusion web page
    By TheresaR in forum Macromedia ColdFusion
    Replies: 10
    Last Post: June 16th, 12:23 PM
  4. Page and bookmarks view
    By Ulia_Oh@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 2
    Last Post: May 18th, 04:31 PM
  5. Page View Trouble
    By Christopher Gallagher in forum Web Design
    Replies: 1
    Last Post: December 16th, 02:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139