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. problem related to linkbuuton

problem related to linkbuuton

Scheduled Pinned Locked Moved ASP.NET
csharphelptutorial
9 Posts 5 Posters 1 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
    biswa47
    wrote on last edited by
    #1

    hi frndz... i have a very small problem .. plz help me out.. last time i aske did qns but no body answered me.. hope dis time get the soln. i have link button and panel. i want to display the panel while click on the link button first time and while clicking on the same link button another time dat panel should be disable. i am only able enable the panel on the first click on the link button. but how to disble it on 2nd click. like wise if i clicked on the 3rd time the panel will be enable and if i clicked it 4 4th time d panel will again disable.. plz help me out.i am developing my project n c#.net

    S P N J 4 Replies Last reply
    0
    • B biswa47

      hi frndz... i have a very small problem .. plz help me out.. last time i aske did qns but no body answered me.. hope dis time get the soln. i have link button and panel. i want to display the panel while click on the link button first time and while clicking on the same link button another time dat panel should be disable. i am only able enable the panel on the first click on the link button. but how to disble it on 2nd click. like wise if i clicked on the 3rd time the panel will be enable and if i clicked it 4 4th time d panel will again disable.. plz help me out.i am developing my project n c#.net

      S Offline
      S Offline
      Sun Rays
      wrote on last edited by
      #2

      Hi, try this, on link button click event check If panel.visible == true then make it false. Else make it true. :) if(Panel1.Visible == true) Panel1.Visible = false; else Panel1.Visible = true;

      Thanks, Sun Rays To get something you must have to try once. My Articles

      modified on Monday, December 17, 2007 12:36:25 AM

      1 Reply Last reply
      0
      • B biswa47

        hi frndz... i have a very small problem .. plz help me out.. last time i aske did qns but no body answered me.. hope dis time get the soln. i have link button and panel. i want to display the panel while click on the link button first time and while clicking on the same link button another time dat panel should be disable. i am only able enable the panel on the first click on the link button. but how to disble it on 2nd click. like wise if i clicked on the 3rd time the panel will be enable and if i clicked it 4 4th time d panel will again disable.. plz help me out.i am developing my project n c#.net

        P Offline
        P Offline
        Parwej Ahamad
        wrote on last edited by
        #3

        Hi you do this in two way : (1) Server Side : Link button click Event if( Session["pnlFlag"] != null ) { bool flg=(bool)Session["pnlFlag"]; if (Flg == true ) Session["pnlFlag"]=false; else Session["pnlFlag"]=true; } else Session["pnlFlag"]=true; Then on page load if( Session["pnlFlag"] != null ) yourPanle.visible=(bool)Session["pnlFlag"]; else //set the default visible of panel what you want OR (2) You can handle it client side mean java script. if you want then let me know

        /***********************/ * Parwej Ahamad * * g.parwez@gmail.com * /***********************/

        S 1 Reply Last reply
        0
        • P Parwej Ahamad

          Hi you do this in two way : (1) Server Side : Link button click Event if( Session["pnlFlag"] != null ) { bool flg=(bool)Session["pnlFlag"]; if (Flg == true ) Session["pnlFlag"]=false; else Session["pnlFlag"]=true; } else Session["pnlFlag"]=true; Then on page load if( Session["pnlFlag"] != null ) yourPanle.visible=(bool)Session["pnlFlag"]; else //set the default visible of panel what you want OR (2) You can handle it client side mean java script. if you want then let me know

          /***********************/ * Parwej Ahamad * * g.parwez@gmail.com * /***********************/

          S Offline
          S Offline
          Sun Rays
          wrote on last edited by
          #4

          Hi,

          Parwej Ahamad wrote:

          Link button click Event if( Session["pnlFlag"] != null ) { bool flg=(bool)Session["pnlFlag"]; if (Flg == true ) Session["pnlFlag"]=false; else Session["pnlFlag"]=true; } else Session["pnlFlag"]=true; Then on page load if( Session["pnlFlag"] != null ) yourPanle.visible=(bool)Session["pnlFlag"]; else //set the default visible of panel what you want OR

          Why to use Session ? No need to use it.

          Thanks, Sun Rays To get something you must have to try once. My Articles

          1 Reply Last reply
          0
          • B biswa47

            hi frndz... i have a very small problem .. plz help me out.. last time i aske did qns but no body answered me.. hope dis time get the soln. i have link button and panel. i want to display the panel while click on the link button first time and while clicking on the same link button another time dat panel should be disable. i am only able enable the panel on the first click on the link button. but how to disble it on 2nd click. like wise if i clicked on the 3rd time the panel will be enable and if i clicked it 4 4th time d panel will again disable.. plz help me out.i am developing my project n c#.net

            N Offline
            N Offline
            N a v a n e e t h
            wrote on last edited by
            #5

            Use ViewState and keep the clicked status there. Check this status on link button click and show/hide it as well.

            if(ViewState["PanelVisible"] != null && (bool)ViewState["PanelVisible"] == true)
            {
            //hide you panel here
            ViewState["PanelVisible"] = false;
            }
            else
            {
            //show your panel here
            ViewState["PanelVisible"] = true;
            }

            use this on your link buttons onclick event.

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

            S 1 Reply Last reply
            0
            • B biswa47

              hi frndz... i have a very small problem .. plz help me out.. last time i aske did qns but no body answered me.. hope dis time get the soln. i have link button and panel. i want to display the panel while click on the link button first time and while clicking on the same link button another time dat panel should be disable. i am only able enable the panel on the first click on the link button. but how to disble it on 2nd click. like wise if i clicked on the 3rd time the panel will be enable and if i clicked it 4 4th time d panel will again disable.. plz help me out.i am developing my project n c#.net

              J Offline
              J Offline
              John ph
              wrote on last edited by
              #6

              How about using a DIV tag and writting a javascript to toggle the DIV on the click of Link button?

              function ToggleDIV(divid) {
              if (document.getElementById(divid).style.display == 'none')
              document.getElementById(divid).style.display="inline";
              else
              document.getElementById(divid).style.display="none";
              }

              - Regards -
                 JON


              Life is not measured by the amount of breaths we take, but by the moments that take our breath away.


              1 Reply Last reply
              0
              • N N a v a n e e t h

                Use ViewState and keep the clicked status there. Check this status on link button click and show/hide it as well.

                if(ViewState["PanelVisible"] != null && (bool)ViewState["PanelVisible"] == true)
                {
                //hide you panel here
                ViewState["PanelVisible"] = false;
                }
                else
                {
                //show your panel here
                ViewState["PanelVisible"] = true;
                }

                use this on your link buttons onclick event.

                All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

                S Offline
                S Offline
                Sun Rays
                wrote on last edited by
                #7

                N a v a n e e t h wrote:

                if(ViewState["PanelVisible"] != null && (bool)ViewState["PanelVisible"] == true){ //hide you panel here ViewState["PanelVisible"] = false;}else{ //show your panel here ViewState["PanelVisible"] = true;}

                Hi, Why to use viewstate ?? We can do it in simple way. Without using ViewState["PanelVisible"] or Session.

                Thanks, Sun Rays To get something you must have to try once. My Articles

                N 1 Reply Last reply
                0
                • S Sun Rays

                  N a v a n e e t h wrote:

                  if(ViewState["PanelVisible"] != null && (bool)ViewState["PanelVisible"] == true){ //hide you panel here ViewState["PanelVisible"] = false;}else{ //show your panel here ViewState["PanelVisible"] = true;}

                  Hi, Why to use viewstate ?? We can do it in simple way. Without using ViewState["PanelVisible"] or Session.

                  Thanks, Sun Rays To get something you must have to try once. My Articles

                  N Offline
                  N Offline
                  N a v a n e e t h
                  wrote on last edited by
                  #8

                  It's the two ways for the problem. Your method also will work, which does what I wrote, internally.

                  All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

                  S 1 Reply Last reply
                  0
                  • N N a v a n e e t h

                    It's the two ways for the problem. Your method also will work, which does what I wrote, internally.

                    All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

                    S Offline
                    S Offline
                    Sun Rays
                    wrote on last edited by
                    #9

                    Hi, thats true. But what my question is. If we can solve it without using viewstate then why to use it ? Bcoz smart coding it this. :cool: Anyways good to hear that my method can work. :laugh:

                    Thanks, Sun Rays To get something you must have to try once. My Articles

                    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