模态弹出式扩展器渲染问题. [英] Modal Popup Extender rendering problem.

查看:99
本文介绍了模态弹出式扩展器渲染问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专家,

在我的网站 Nridubai.com 网站中,我正在显示

所有公司及其要管理的信息.

为此,我使用了gridview控件,并且每个gridview单元都是可单击的.

我为此使用以下代码,

Hi Expert,

In My website Nridubai.com website i am showing

all companies and their information to admin.

For this purpose I have use gridview control, And each gridview cell is clickable.

And i am using following code for this,

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  {
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
          if (e.Row.RowType == DataControlRowType.DataRow)
          {
              LinkButton _singleClickButton = (LinkButton)e.Row.Cells[0].Controls[0];
              string _jsSingle = ClientScript.GetPostBackClientHyperlink(_singleClickButton, "");
              // Add events to each editable cell
              for (int columnIndex = 0; columnIndex < e.Row.Cells.Count; columnIndex++)
              {
                  // Add the column index as the event argument parameter
                  string js = _jsSingle.Insert(_jsSingle.Length - 2, columnIndex.ToString());
                  // Add this javascript to the onclick Attribute of the cell
                  e.Row.Cells[columnIndex].Attributes["onclick"] = js;
                  // Add a cursor style to the cells
                  e.Row.Cells[columnIndex].Attributes["style"] += "cursor:pointer;cursor:hand;";
              }
          }
      }
  }



我正在获取 GridView1_RowCommand事件上的单元格列索引和行索引

到此为止对我来说一切正常.


现在,单击时必须在弹出窗口中显示每个单元格值.

现在我正在使用MOdalpopup扩展器(mpe).在这种情况下,我使用2个文本框,一个用于公司,第二个用于颜色.
但是当我单击单元格时,它可以正确打开modalpopup,但是无法显示与文本框关联的值.

在调试过程中,将值正确分配给textbox.但是当它打开popup时,文本框显示空白值.如果假设我在其中输入内容,然后关闭然后再次打开modalpop,它们将显示现有值.

而且我认为此问题是由于以下方法而发生的



And I am fetching cell column index and row index on GridView1_RowCommand event

Upto this working fine for me.


Now i have to display each cell value in popup when i click.

And i now i am using MOdalpopup extender(mpe).In that i take 2 textbox one for company and second for color.

But when i click cell,it opens modalpopup correctly,but failed to display the value associated with textboxes.

During debuging values assigning properly to textbox.but when it opens popup ,textboxes showing blank value.and if suppose i type something in it and close and then open modalpop again ,they showing existing values.

And i think this problem occurs due to following method

protected override void Render(HtmlTextWriter writer)
   {
       foreach (GridViewRow r in GridView1.Rows)
       {
           if (r.RowType == DataControlRowType.DataRow)
           {
               for (int columnIndex = 0; columnIndex < r.Cells.Count; columnIndex++)
               {
                   Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl00", columnIndex.ToString());
               }
           }
       }

       base.Render(writer);
   }




请帮我解决问题,对不起我的英语不好.

在此先感谢.




Please help me sort out the problem,And sorry for my poor english.

Thanks in advance.

推荐答案

ctl00",columnIndex.ToString()); } } } 基本 .Render(writer); }
ctl00", columnIndex.ToString()); } } } base.Render(writer); }




请帮助我解决问题,对不起我的英语不好.

预先谢谢.




Please help me sort out the problem,And sorry for my poor english.

Thanks in advance.


对不起,大家,我忘了包含更新面板.

现在上面的代码对我来说很好用.
Sorry everyone,i forgot to include update panel.

Now above code is working fine for me.


这篇关于模态弹出式扩展器渲染问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆