Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What i am trying to do is on repeaters row click i want to generate popup containg value to fill belongs to that row ...

ASP.NET
<asp:Repeater ID="repEmpHeadings" OnItemCommand="repEmpHeadings_ItemCommand" runat="server" OnItemDataBound="repEmpHeadings_ItemDataBound">
  <ItemTemplate>
    <div onclick="<%# getPostbackReference((string) Eval("CalibrationProfileId").ToString() + ";" +Eval("EmpCalibrationHeadingId").ToString() + ";" + Eval("HeadingId").ToString() ) %>">
<%# Container.DataItem %>
      <div></div>
      <div></div>
      <div></div>
    </div>
  </ItemTemplate>
</asp:Repeater>

On my page load :-
C#
if (IsPostBack)
                {
                    string arg = Request["__EVENTARGUMENT"];
                    if (string.IsNullOrEmpty(arg) == false)
                    {
                        if (arg.StartsWith("row"))
                        {
                            string[] arg1 = new string[3];
                            arg1 = arg.Substring(arg.IndexOf("#") + 1).ToString().Split(';');
                            string v = arg.Substring(arg.IndexOf("#") + 1);
                            mpCompetencyDetails.Show();
                            EditMidYearCompetencyDetails(Convert.ToInt32(arg1[0]), Convert.ToInt32(arg1[1]), Convert.ToInt32(arg1[2]));
                        }
                    }
                }

This is myn other method
C#
protected string getPostbackReference(string Name)
      {
          return ClientScript.GetPostBackEventReference(this, "rowEvent#" + Name);
      }

model popup is coming , but the id which i am passing on div click event are not coming proper all the time
Posted
Updated 1-Jul-14 20:00pm
v3
Comments
Kornfeld Eliyahu Peter 2-Jul-14 2:01am    
You should debug your getPostbackReference method - what it gets and what it returns...
Torakami 2-Jul-14 3:03am    
no the thing is , i am getting the proper id for 2, 3 postback , but suddenly automatic ids gets generated in betwween which is not belong to ,,,, so not getting why is this happening ..
Kornfeld Eliyahu Peter 2-Jul-14 3:04am    
Do you change data source between post-back?
Torakami 2-Jul-14 3:05am    
no .. actually it is present inside other repeater ... and parents databound event i am binding this repeater .. so its not that the case where its chnaging ...


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900