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. Extending login webcontrol

Extending login webcontrol

Scheduled Pinned Locked Moved ASP.NET
asp-netcsharpcomhelpquestion
4 Posts 2 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.
  • R Offline
    R Offline
    Rey9999
    wrote on last edited by
    #1

    Hello everybody, I read the excellent article about inserting a captcha control in a webpage, located here[^]. I liked so much the idea, that I wanted to extend the standard Login webcontrol which comes with ASP.NET 2.0, by adding a captcha image to be read and its content typed into a textbox. The solution I found in the article uses the Page Session to generate an unique ID, that is then compared to what the user types. My problem is that when I try to implement the very same solution in the webcontrol, I cannot access the Page object at all! It's like I cannot retrieve the page object my new webcontrol refers to, from within the control itself. Is there some workaround to access the Page property? If not, what could I use to generate an unique ID to be compared? I was thinking of simply generating a random number, but I do not know if it's recommendable. Thanks in advance Rey9999

    ~~~ From Milano to The Hague, easy as it goes ~~~

    N 1 Reply Last reply
    0
    • R Rey9999

      Hello everybody, I read the excellent article about inserting a captcha control in a webpage, located here[^]. I liked so much the idea, that I wanted to extend the standard Login webcontrol which comes with ASP.NET 2.0, by adding a captcha image to be read and its content typed into a textbox. The solution I found in the article uses the Page Session to generate an unique ID, that is then compared to what the user types. My problem is that when I try to implement the very same solution in the webcontrol, I cannot access the Page object at all! It's like I cannot retrieve the page object my new webcontrol refers to, from within the control itself. Is there some workaround to access the Page property? If not, what could I use to generate an unique ID to be compared? I was thinking of simply generating a random number, but I do not know if it's recommendable. Thanks in advance Rey9999

      ~~~ From Milano to The Hague, easy as it goes ~~~

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Rather than creating your own user control, couldn't use the login control template to include the captcha?


      only two letters away from being an asset

      R 1 Reply Last reply
      0
      • N Not Active

        Rather than creating your own user control, couldn't use the login control template to include the captcha?


        only two letters away from being an asset

        R Offline
        R Offline
        Rey9999
        wrote on last edited by
        #3

        I could.. but you know, this was not something I needed done for work, it was just to see if I were still able to extend existing cotrols. I liked the "login+captcha" idea, that's all. Anyway, I went with the random number approach, not so elegant but it works. Now I have another problem: How can I tell the control that it first has to check the correctness of the captcha? I tried overriding the event OnLoggingIn, but this seems to happen when the login has already taken place. Any ideas? Thanks in advance Rey9999

        ~~~ From Milano to The Hague, easy as it goes ~~~

        R 1 Reply Last reply
        0
        • R Rey9999

          I could.. but you know, this was not something I needed done for work, it was just to see if I were still able to extend existing cotrols. I liked the "login+captcha" idea, that's all. Anyway, I went with the random number approach, not so elegant but it works. Now I have another problem: How can I tell the control that it first has to check the correctness of the captcha? I tried overriding the event OnLoggingIn, but this seems to happen when the login has already taken place. Any ideas? Thanks in advance Rey9999

          ~~~ From Milano to The Hague, easy as it goes ~~~

          R Offline
          R Offline
          Rey9999
          wrote on last edited by
          #4

          The random number approach is a failure: since the page seems to reload the control after the loggingin procedure, I cannot have a unique identifier for each login attempt, beside the page session. But how can I access it from the webcontrol itself? Any help would be much appreciated. Thank you. Rey9999

          ~~~ From Milano to The Hague, easy as it goes ~~~

          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