本文介绍了在ms中运行良好,但在iis中发布时则不行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在扫描图像并在图像控件中显示。当我遇到ms visual studio时运行良好但是当我在iis管理器上发布时它显示没有什么不能理解是什么问题..

请帮帮我

这是我的page_load



i'm ulpoading an image and showing in image control.it run good when i run into ms visual studio but when i publish on iis manager it shows nothing cant understand what is the problem..
please help me
this is my page_load

protected void Page_Load(object sender, EventArgs e)
      {
          //Session.Timeout = 90;

          string username = (string)(Session["UserAuthentication"]);
              if(Session["UserAuthentication"]!=null)
              {
                  Label2.Text = username;
                  //Get all the images stored in images directory
                  //string[] filePaths = Directory.GetFiles(Server.MapPath("Images/"));
                  //Search the image with same name as username
                 // string path = filePaths.AsEnumerable().Where(s => s.Contains(username)).First();
                  //Assign the path
                  //Image1.ImageUrl = path;
                  //Image1.ImageUrl = "Images/" + username;

                  string query = "SELECT imgpath FROM imagepath where imagename='" + username + "'";
                  con = new SqlConnection(connstring);
                  cmd = new SqlCommand(query, con);
                  SqlDataReader sdr;
                  con.Open();
                  sdr = cmd.ExecuteReader();
                  while (sdr.Read())
                  {
                      Image1.ImageUrl = sdr[0].ToString();
                  }
                  con.Close();



              }

推荐答案


这篇关于在ms中运行良好,但在iis中发布时则不行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 12:32