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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. user control in asp.net

user control in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-nethelp
6 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.
  • S Offline
    S Offline
    saravanan05
    wrote on last edited by
    #1

    hi friends i have one usercontrol page. i did validation for username,password. i wrote javascript in client side i need this usercontrol aspx page how i call the javascript function in aspx page i tried to call the function in aspx form load but it showed error. i tried to call the function in usercontrol button click but it also showed error. regards saravanan

    T S 2 Replies Last reply
    0
    • S saravanan05

      hi friends i have one usercontrol page. i did validation for username,password. i wrote javascript in client side i need this usercontrol aspx page how i call the javascript function in aspx page i tried to call the function in aspx form load but it showed error. i tried to call the function in usercontrol button click but it also showed error. regards saravanan

      T Offline
      T Offline
      Tzumer Edo
      wrote on last edited by
      #2

      You got the main idea wrong buddy, the javascript run CLIENT SIDE, the code you write in c# runs SERVER SIDE. Javascript functions enable you to do stuff when the page is at the client. if you want, say, to run a javascript function when the page reaches the client, you can simply call it in javascript on the page : MyFunction();<script> that way its sure to run when the page load (provided the function exists) Cheers, Tzumer Edo. </x-turndown>

      1 Reply Last reply
      0
      • S saravanan05

        hi friends i have one usercontrol page. i did validation for username,password. i wrote javascript in client side i need this usercontrol aspx page how i call the javascript function in aspx page i tried to call the function in aspx form load but it showed error. i tried to call the function in usercontrol button click but it also showed error. regards saravanan

        S Offline
        S Offline
        Sandeep Akhare
        wrote on last edited by
        #3

        HI User control file extension should be ascx Register the user control in your html by using Register tag <%@ Register tagprefix="mmCollectionUC" tagname="RecCollectionCancelVerify" src="UserControls\RecCollectionDetail.ascx" %> and also specify the js file where you have written the javascript code for the user control in aspx page use the control where you want in the aspx page by adding

        Thanks and Regards Sandeep

        S 1 Reply Last reply
        0
        • S Sandeep Akhare

          HI User control file extension should be ascx Register the user control in your html by using Register tag <%@ Register tagprefix="mmCollectionUC" tagname="RecCollectionCancelVerify" src="UserControls\RecCollectionDetail.ascx" %> and also specify the js file where you have written the javascript code for the user control in aspx page use the control where you want in the aspx page by adding

          Thanks and Regards Sandeep

          S Offline
          S Offline
          saravanan05
          wrote on last edited by
          #4

          i create login page as usercontrol how can i validate the textboxes in usercontrol give some code for that. I want to call the login usercontrol in nearly 10 aspx pages. So how can i do that. Give me some code for that.

          S B 2 Replies Last reply
          0
          • S saravanan05

            i create login page as usercontrol how can i validate the textboxes in usercontrol give some code for that. I want to call the login usercontrol in nearly 10 aspx pages. So how can i do that. Give me some code for that.

            S Offline
            S Offline
            Sandeep Akhare
            wrote on last edited by
            #5

            Hi Tell me the file name of your user control. i alredy have given how to register ok for validation you can use requiredfeild validator and range or custom validators for your controls OK you can use that user control any number of pages by doing following 2 things 1)You have to Register your user control in the aspx page in which you want to use by <%@ Register tagprefix="mmUserControl" tagname="TagNameUserControl" src="Give Path Of UserControl witn name .ascx" %> 2) now use it in your aspx page whereever you want

            Thanks and Regards Sandeep

            1 Reply Last reply
            0
            • S saravanan05

              i create login page as usercontrol how can i validate the textboxes in usercontrol give some code for that. I want to call the login usercontrol in nearly 10 aspx pages. So how can i do that. Give me some code for that.

              B Offline
              B Offline
              badgrs
              wrote on last edited by
              #6

              No one will give you anything. If they are feeling generous they might help you on the road to finding it yourself. For validation you can use the built in ASP.NET validation controls - they do both server side and client side validations automagically!

              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