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. Any asp.net control

Any asp.net control

Scheduled Pinned Locked Moved ASP.NET
csharpjavascripthtmlasp-nethelp
5 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.
  • M Offline
    M Offline
    Member 4065472
    wrote on last edited by
    #1

    hi evrybody i am looking for solution to this 1.i have form in which there is 3 fields textbox=>school textbox=>Major dropdownlist=>Degree 2. i want to place button (Add Education) which will add another set of same controls with diffrent ids 3. and i want to place button (Delete Education) which will delete the last added conrol set by (Add Education) i know i have tried by javascript by copying from site i was inspired by desighn of this kind of user control but i ended up in tears because id generated by javascript was like ****ucResDesiredPos:Relocation~RelocationStateProvince~0~0*** which is not allowed by asp.net contorls please help me with clear solution because i am new to asp.net it works fine by javascript and normal html contol but not with asp.net conrols...will it be possible by multi view thank you very much in advance please helppppp

    appu

    M K 2 Replies Last reply
    0
    • M Member 4065472

      hi evrybody i am looking for solution to this 1.i have form in which there is 3 fields textbox=>school textbox=>Major dropdownlist=>Degree 2. i want to place button (Add Education) which will add another set of same controls with diffrent ids 3. and i want to place button (Delete Education) which will delete the last added conrol set by (Add Education) i know i have tried by javascript by copying from site i was inspired by desighn of this kind of user control but i ended up in tears because id generated by javascript was like ****ucResDesiredPos:Relocation~RelocationStateProvince~0~0*** which is not allowed by asp.net contorls please help me with clear solution because i am new to asp.net it works fine by javascript and normal html contol but not with asp.net conrols...will it be possible by multi view thank you very much in advance please helppppp

      appu

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      You may want to use DataGrid for that. Add the textboxes and dropdownlist in Datagrid and you can use Gird footer for adding new records. It would be more easier for you.

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

      1 Reply Last reply
      0
      • M Member 4065472

        hi evrybody i am looking for solution to this 1.i have form in which there is 3 fields textbox=>school textbox=>Major dropdownlist=>Degree 2. i want to place button (Add Education) which will add another set of same controls with diffrent ids 3. and i want to place button (Delete Education) which will delete the last added conrol set by (Add Education) i know i have tried by javascript by copying from site i was inspired by desighn of this kind of user control but i ended up in tears because id generated by javascript was like ****ucResDesiredPos:Relocation~RelocationStateProvince~0~0*** which is not allowed by asp.net contorls please help me with clear solution because i am new to asp.net it works fine by javascript and normal html contol but not with asp.net conrols...will it be possible by multi view thank you very much in advance please helppppp

        appu

        K Offline
        K Offline
        Kariem Soudy
        wrote on last edited by
        #3

        hello, please follow these steps: 1)create a web user control named Education and contains your 3 controls and customize it as u like,it should be like this: **]]>
        School
         Major
        Degree
        **2)in your webform add this directive in the top of the page code right after the <%@ page %> directive: ]]> 3)add this code in your webform code: <% try { int ItemsCount = 0; ItemsCount = Convert.ToInt32(Session["ItemsCount"].ToString()); for (int i = 0; i < ItemsCount; i++) { int Counter = i + 1; Education1.ID = "Education" + Counter.ToString(); %> <% } } catch (Exception ex) { } %> 4)add a button and type this in the click event; if (Session["ItemsCount"] != null) { int SessionValue = Convert.ToInt32(Session["ItemsCount"].ToString()); SessionValue++; Session["ItemsCount"] = SessionValue.ToString(); } else { Session["ItemsCount"] = "1"; } that's it, and you may put all of that in an updatepanel to have the AJAX effect.... i wish that could help you, please let me know if there're any errors...

        Web Developer @ Silverkey Egypt

        K M 2 Replies Last reply
        0
        • K Kariem Soudy

          hello, please follow these steps: 1)create a web user control named Education and contains your 3 controls and customize it as u like,it should be like this: **]]>
          School
           Major
          Degree
          **2)in your webform add this directive in the top of the page code right after the <%@ page %> directive: ]]> 3)add this code in your webform code: <% try { int ItemsCount = 0; ItemsCount = Convert.ToInt32(Session["ItemsCount"].ToString()); for (int i = 0; i < ItemsCount; i++) { int Counter = i + 1; Education1.ID = "Education" + Counter.ToString(); %> <% } } catch (Exception ex) { } %> 4)add a button and type this in the click event; if (Session["ItemsCount"] != null) { int SessionValue = Convert.ToInt32(Session["ItemsCount"].ToString()); SessionValue++; Session["ItemsCount"] = SessionValue.ToString(); } else { Session["ItemsCount"] = "1"; } that's it, and you may put all of that in an updatepanel to have the AJAX effect.... i wish that could help you, please let me know if there're any errors...

          Web Developer @ Silverkey Egypt

          K Offline
          K Offline
          Kariem Soudy
          wrote on last edited by
          #4

          please note that this tag will not be included while you type the code i've shown: **and ]]> please remove it, thnx

          Web Developer @ Silverkey Egypt

          **

          1 Reply Last reply
          0
          • K Kariem Soudy

            hello, please follow these steps: 1)create a web user control named Education and contains your 3 controls and customize it as u like,it should be like this: **]]>
            School
             Major
            Degree
            **2)in your webform add this directive in the top of the page code right after the <%@ page %> directive: ]]> 3)add this code in your webform code: <% try { int ItemsCount = 0; ItemsCount = Convert.ToInt32(Session["ItemsCount"].ToString()); for (int i = 0; i < ItemsCount; i++) { int Counter = i + 1; Education1.ID = "Education" + Counter.ToString(); %> <% } } catch (Exception ex) { } %> 4)add a button and type this in the click event; if (Session["ItemsCount"] != null) { int SessionValue = Convert.ToInt32(Session["ItemsCount"].ToString()); SessionValue++; Session["ItemsCount"] = SessionValue.ToString(); } else { Session["ItemsCount"] = "1"; } that's it, and you may put all of that in an updatepanel to have the AJAX effect.... i wish that could help you, please let me know if there're any errors...

            Web Developer @ Silverkey Egypt

            M Offline
            M Offline
            Member 4065472
            wrote on last edited by
            #5

            thank you for helping but the code u gave me was in c# and i use vb but i did manage to get it working but nothings hapening

            appu

            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