Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Alert Box

Alert Box

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-nethelp
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Balwan
    wrote on last edited by
    #1

    Sir/Madam My problem is that I have to check a textbox that it may contain some text or not on clicking a button if it not contain any text then i have to display a message box that you nave not entered any value or you have entered null. it may be done by using javascript or asp.net:confused::confused: Balwan Singh

    M G O 3 Replies Last reply
    0
    • B Balwan

      Sir/Madam My problem is that I have to check a textbox that it may contain some text or not on clicking a button if it not contain any text then i have to display a message box that you nave not entered any value or you have entered null. it may be done by using javascript or asp.net:confused::confused: Balwan Singh

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      For ASP.NET, look at the RequiredFieldValidator[^] control. -- modified at 8:52 Monday 1st May, 2006 I hadn't noticed that you had already asked this question earlier. Did you not like the responses you got? They looked pretty good to me.

      1 Reply Last reply
      0
      • B Balwan

        Sir/Madam My problem is that I have to check a textbox that it may contain some text or not on clicking a button if it not contain any text then i have to display a message box that you nave not entered any value or you have entered null. it may be done by using javascript or asp.net:confused::confused: Balwan Singh

        G Offline
        G Offline
        goyal manish
        wrote on last edited by
        #3

        for javascript on the click of button call a function in javascript there check for value of text box if it is empty then display a alert box with message and return false else pass true without displaying the alert box.

        1 Reply Last reply
        0
        • B Balwan

          Sir/Madam My problem is that I have to check a textbox that it may contain some text or not on clicking a button if it not contain any text then i have to display a message box that you nave not entered any value or you have entered null. it may be done by using javascript or asp.net:confused::confused: Balwan Singh

          O Offline
          O Offline
          OmegaCD
          wrote on last edited by
          #4

          Hi! I created a class called HelperClass where I have a lot of methods that help me with situations like this one. Here goes the code of the method to provide an alert window: public static void MsgBox(System.Web.UI.Page page,string msg) { msg = msg.Replace("'","\\'"); page.RegisterStartupScript("msg","alert('" + msg + "');"); } I also have other methods, if you need them let me know. I also found some free online tutorials at www.KYNOU.com I hope I helped. sfdsfsdf

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups