×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

请教有人知道如何实现这个效果吗?如果用javascript,ajax都可以接受,如果.net的方法更好,先谢了。

popup一个window(alert),背景暗掉,等待用户选择确认或者取消。
Report

Replies, comments and Discussions:

  • 工作学习 / 学科技术讨论 / 请教有人知道如何实现这个效果吗?如果用javascript,ajax都可以接受,如果.net的方法更好,先谢了。
    popup一个window(alert),背景暗掉,等待用户选择确认或者取消。
    • 画一个全屏白色透明的div
      • Never thing about this way, it is cool for me
        • glad to see u like that, this is what we did with a modal div over a shadow div. if u interest
          本文发表在 rolia.net 枫下论坛//add a control that will blot out the others
          HtmlGenericControl divOverlay = new HtmlGenericControl("div");
          divOverlay.Style["background-color"] = "#EBEBEB";
          divOverlay.Style["width"] = "100%";
          divOverlay.Style["height"] = "100%";
          divOverlay.Style["position"] = "absolute";
          divOverlay.Style["top"] = "0px";
          divOverlay.Style["left"] = "0px";
          divOverlay.Style["filter"] = "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";


          //add a "modal" div that shows overtop of everything
          HtmlGenericControl div = new HtmlGenericControl("div");
          div.Style["width"] = "100%";
          div.Style["height"] = "70%";
          div.Style["position"] = "absolute";
          div.Style["top"] = "30%";
          div.Attributes["align"] = "center";

          HtmlGenericControl div2 = new HtmlGenericControl("div");
          div2.Attributes["style"] = "background-color: white; border: 1px solid gray; padding: 8px; text-align:left; width: 300px";

          //show a table with an editable version of the "Edited" column
          HtmlTable table = new HtmlTable();
          HtmlTableRow row = new HtmlTableRow();
          HtmlTableCell cell1 = new HtmlTableCell();
          HtmlTableCell cell2 = new HtmlTableCell();
          cell2.Align = "right";
          table.Border = 0;
          table.Width = "100%";
          table.Rows.Add(row);
          row.Cells.Add(cell1);
          row.Cells.Add(cell2);

          Literal lit = new Literal();
          lit.Text = "Edit selected " + inputElem.GetAttribute("gridlabel").Replace(" ", " ") + ":  ";
          Control c = Page.ParseControl(inputElem.OuterXml);
          if (c.Controls.Count == 1) c = c.Controls[0];
          cell1.Controls.Add(lit);

          if (c is HtmlInputControl && ((HtmlInputControl)c).Attributes["readonly"] == "true") ((HtmlInputControl)c).Attributes.Remove("readonly");
          if (c is HtmlSelect && ((HtmlSelect)c).Style["display"] == "none") ((HtmlSelect)c).Style.Remove("display");



          cell1.Controls.Add(c);

          //add the validators
          AddValidatorsAndDataSources(cell1, c, c.ID, inputElem, false);


          HtmlButton buttonOK = new HtmlButton();
          buttonOK.InnerText = "Update";

          buttonOK.Attributes["onclick"] = Page.ClientScript.GetPostBackEventReference(new PostBackOptions(this, "UpdateColumn", "", true, false, false, true, true, ""));

          HtmlButton buttonCancel = new HtmlButton();
          buttonCancel.InnerText = "Cancel";
          buttonCancel.Attributes["onclick"] = Page.ClientScript.GetPostBackEventReference(new PostBackOptions(this, "CancelColumnEdit", "", true, false, false, true, false, ""));

          Literal litSpace = new Literal();
          litSpace.Text = " ";

          cell2.Controls.Add(buttonOK);
          cell2.Controls.Add(litSpace);
          cell2.Controls.Add(buttonCancel);


          div.Controls.Add(div2);
          div2.Controls.Add(table);

          Controls.Add(divOverlay);
          Controls.Add(div);更多精彩文章及讨论,请光临枫下论坛 rolia.net
          • thanks,buddy.
          • 你又发明了一个车轮, 哈哈, 用GrayBox或Modalbox只要一句话就搞定了.
            • i didnt invent this, this code from my duddy, i like it because it does the work. of course u can use whatever u like. but keep in mind, in some company, there might a issue to use outside js functions.
              • RE: Reinventing the wheel
              • I like the whell your team "invented". Can you give me a simple but full example? Can't implentment with the code in your last post. Thanks.
    • IE下面可以实现,用window.showModalDialog(). http://shf.cnblogs.com/archive/2006/02/24/336806.aspx
      • 这个blog不错,谢谢。
    • 就是一张图片
    • ModalBox or GrayBox Javascript Lib will meet your requirement
      • 多谢,这里高人真多。
      • Holly $&%^, this is really cool, I never though JS could do that. What's the idea behind that (fade effect)?
    • 我来推荐一个.NET+Ajax的
      • thanks,that's cool,man.that's what i am looking for.
    • very easy with dojo or extjs pakage
    • ajax lib - prototype window