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. ASP Button not displaying on Windows 2012 Server

ASP Button not displaying on Windows 2012 Server

Scheduled Pinned Locked Moved ASP.NET
graphicssysadmin
6 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.
  • P Offline
    P Offline
    pmcm
    wrote on last edited by
    #1

    I've an application that displays information in a gridview:

    the status of the button is set

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
    try
    {
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
    DataRowView entry = e.Row.DataItem as DataRowView;
    if (entry != null)
    {
    switch (entry["State"] as string)
    {
    case "Stopped":
    e.Row.Cells[2].BackColor = System.Drawing.Color.OrangeRed;
    e.Row.Cells[2].ForeColor = System.Drawing.Color.White;
    ((Button)e.Row.Cells[7].Controls[

    A Z 2 Replies Last reply
    0
    • P pmcm

      I've an application that displays information in a gridview:

      the status of the button is set

      protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
      {
      try
      {
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
      DataRowView entry = e.Row.DataItem as DataRowView;
      if (entry != null)
      {
      switch (entry["State"] as string)
      {
      case "Stopped":
      e.Row.Cells[2].BackColor = System.Drawing.Color.OrangeRed;
      e.Row.Cells[2].ForeColor = System.Drawing.Color.White;
      ((Button)e.Row.Cells[7].Controls[

      A Offline
      A Offline
      Afzaal Ahmad Zeeshan
      wrote on last edited by
      #2

      Did you try to look into, why it was empty? Your server's variables are not shown to us and we cannot debug it without enough information.

      The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

      P 1 Reply Last reply
      0
      • A Afzaal Ahmad Zeeshan

        Did you try to look into, why it was empty? Your server's variables are not shown to us and we cannot debug it without enough information.

        The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

        P Offline
        P Offline
        pmcm
        wrote on last edited by
        #3

        besides debugging the application and stepping through the code that sets the buttons values what else can I do? In my test the code is hitting this case within the switch:

        case "Stopped":
        e.Row.Cells[2].BackColor = System.Drawing.Color.OrangeRed;
        e.Row.Cells[2].ForeColor = System.Drawing.Color.White;
        ((Button)e.Row.Cells[7].Controls[1]).Text = "Start";
        ((Button)e.Row.Cells[7].Controls[1]).ForeColor = System.Drawing.Color.Green;
        ((Button)e.Row.Cells[7].Controls[1]).CommandArgument = entry["Site"] as string + "|" + entry["Description"] as string;
        break;

        but when to code has finished running and the webpage is displayed, here's the source of the webpage:

        		[Description](javascript:__doPostBack\('UcSites1$GridView1','Sort$Description'\))[Identifier](javascript:__doPostBack\('UcSites1$GridView1','Sort$Identifier'\))[State](javascript:__doPostBack\('UcSites1$GridView1','Sort$State'\))[Host Header Value](javascript:__doPostBack\('UcSites1$GridView1','Sort$HostHeaderValue'\))[IP Address](javascript:__doPostBack\('UcSites1$GridView1','Sort$IPAddress'\))[Port](javascript:__doPostBack\('UcSites1$GridView1','Sort$Port'\))[SSL Port](javascript:__doPostBack\('UcSites1$GridView1','Sort$SSLPort'\))Button
        	
        		Default Web Site1Stopped  80 
        

        You can see the cell[2] is updated with an OrangeRed background and white text. I've followed the code the whole way through and there is no where else it is manipulated, very strange. What this application does is it reviews the status of Sites setup in IIS and displays their status in the gridview and if the site status = stopped the button should display 'start' and so on.

        1 Reply Last reply
        0
        • P pmcm

          I've an application that displays information in a gridview:

          the status of the button is set

          protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
          {
          try
          {
          if (e.Row.RowType == DataControlRowType.DataRow)
          {
          DataRowView entry = e.Row.DataItem as DataRowView;
          if (entry != null)
          {
          switch (entry["State"] as string)
          {
          case "Stopped":
          e.Row.Cells[2].BackColor = System.Drawing.Color.OrangeRed;
          e.Row.Cells[2].ForeColor = System.Drawing.Color.White;
          ((Button)e.Row.Cells[7].Controls[

          Z Offline
          Z Offline
          ZurdoDev
          wrote on last edited by
          #4

          pmcm wrote:

          the column with the button is empty

          If the column is empty that means you have code somewhere that is hiding the button, .Visible = false; or some other code that is messing something up.

          There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

          P 1 Reply Last reply
          0
          • Z ZurdoDev

            pmcm wrote:

            the column with the button is empty

            If the column is empty that means you have code somewhere that is hiding the button, .Visible = false; or some other code that is messing something up.

            There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

            P Offline
            P Offline
            pmcm
            wrote on last edited by
            #5

            turns out there was a database query that runs to validate the server is in an admin group after the button is set, atm the query is returning null so this is why the button is being disabled. Thanks for all the advice/help

            Z 1 Reply Last reply
            0
            • P pmcm

              turns out there was a database query that runs to validate the server is in an admin group after the button is set, atm the query is returning null so this is why the button is being disabled. Thanks for all the advice/help

              Z Offline
              Z Offline
              ZurdoDev
              wrote on last edited by
              #6

              Glad to see that you narrowed it down.

              There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

              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