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. Validation does not work inside MultiView control

Validation does not work inside MultiView control

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdockerquestion
4 Posts 3 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.
  • A Offline
    A Offline
    Alexander Turlov
    wrote on last edited by
    #1

    Situation: I have a web user control (.ascx) that consists of several text boxes with validators attached. If I place this web user control into a View container inside the MultiView control no one validation handler is called and page is always Valid. Investigation shows that validation events simply are not fired by ASP.NET. If I place the same web user control on the .aspx page it works perfectly. Documentation does not say of any special behavior of validation inside the MultiView. Any clues, explanations, tips? Alexander Turlov Software development consultant, MCSD.NET

    M S 2 Replies Last reply
    0
    • A Alexander Turlov

      Situation: I have a web user control (.ascx) that consists of several text boxes with validators attached. If I place this web user control into a View container inside the MultiView control no one validation handler is called and page is always Valid. Investigation shows that validation events simply are not fired by ASP.NET. If I place the same web user control on the .aspx page it works perfectly. Documentation does not say of any special behavior of validation inside the MultiView. Any clues, explanations, tips? Alexander Turlov Software development consultant, MCSD.NET

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      If your question is still, then I could help if you post your code snippets. Perhaps, my example is simple enough and it's working me when I staticly declare a user control in a View of the MultiView control in the web page .aspx.

      A 1 Reply Last reply
      0
      • M minhpc_bk

        If your question is still, then I could help if you post your code snippets. Perhaps, my example is simple enough and it's working me when I staticly declare a user control in a View of the MultiView control in the web page .aspx.

        A Offline
        A Offline
        Alexander Turlov
        wrote on last edited by
        #3

        Hi, thanks for the answer, but frankly I don't understand what you mean by "staticly declare a user control in a View". Could you give me an example of the code of such a declaration, please? As per my code it's mostly an asp.net markup which simply declares all the controls. Because I use standard validation controls there is almost no code behind. Do you want to see a markup? Thanks in advance. Alexander Turlov Software development consultant, MCSD.NET

        1 Reply Last reply
        0
        • A Alexander Turlov

          Situation: I have a web user control (.ascx) that consists of several text boxes with validators attached. If I place this web user control into a View container inside the MultiView control no one validation handler is called and page is always Valid. Investigation shows that validation events simply are not fired by ASP.NET. If I place the same web user control on the .aspx page it works perfectly. Documentation does not say of any special behavior of validation inside the MultiView. Any clues, explanations, tips? Alexander Turlov Software development consultant, MCSD.NET

          S Offline
          S Offline
          shukraj khadse
          wrote on last edited by
          #4

          I am using Multiview control for displaying tab on my page . here I am writing the code for validation of each tab on my page I have menu item control as well( i.e TabMenu) to display the tab. on clicking the tab it will validate the current tab protected void TabMenu_MenuItemClick(object sender, MenuEventArgs e) { int nextTabIndex = Int32.Parse(e.Item.Value); // here TabMultiView is my multiview control for (int index = 0; index < TabMultiView.Views.Count; index++) { TabMultiView.ActiveViewIndex = index; if (index != nextTabIndex) { // here ValidationGroup is the name of validationgroup in my validation control ex: <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="Login_x0020_Name" ValidationGroup="ValidationGroup" ErrorMessage="Enter Value"></asp:RequiredFieldValidator> Page.Validate("ValidationGroup"); if (!Page.IsValid) { return; } } } } its working perfect if you have any query regarding this blog please let me know.. Cheers Guys.... Life to Set Hai Boss....... Shukraj Khadse Software Engg Datamatics Global Services Andheri, Mumbai

          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