Click here to Skip to main content
15,885,941 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i am displaying a popup div with values from grid view row details by link button but popup disappearing and page is reloading div and its content is disappearing i made popup by javascript code on my clientclick popup is opening data is loading by rowcommand event of grid view how can i solve please help me...

ASP.NET
<asp:LinkButton ID="lnk1" runat="server" PostBackUrl="#" CommandName="ShowTime" CausesValidation="false" OnClientClick="openpopup('popup1')"  CommandArgument='<%# Eval("CityId") + "\\movieticketing\\"+ Eval("DateId")+"\\"+Eval("TheatreId")+"-"+Eval("MovieId")+"\\"+Eval("ConvertedTid")+Eval("ConvertedDate")+Eval("ShowTime")+"*"+Eval("ClazzString") %>'><%# DataBinder.Eval(Container.DataItem, "Showtime")%>

and
C#
protected void GridView_RowCommand(object sender, GridViewCommandEventArgs e)
       {
           if (e.CommandName == "ShowTime")
           {
               string pathForSeatingFile = e.CommandArgument.ToString();
             //  HtmlTable tl = new PlotString().seatingForAllClazzs(pathForSeatingFile);

               seatingdiv.Controls.Add(newPlotString().seatingForAllClazzs(pathForSeatingFile));

           }
       }

thanks in advance...
Posted
Updated 16-Oct-13 0:25am
v3
Comments
Mart Rijkers 16-Oct-13 4:38am    
Maybe you should port some code? It is possble you have a postback action on the event of clicking the link button which displays your popup.
teja sai ravi 16-Oct-13 5:42am    
thanks for ur response pls see code..once
samit kaneriya 16-Oct-13 5:35am    
pl post some code which have problem occur so it help to understand problem.
teja sai ravi 16-Oct-13 5:41am    
thanks for ur response...
teja sai ravi 16-Oct-13 5:41am    
div is loading with seats based on row details on which we clicked but not staying it disappearing fastly...page is reloading..

Try adding
return false;

eg

OnClientClick="openpopup(..etc}; return false;"

This will stop the postback.
 
Share this answer
 
Comments
teja sai ravi 16-Oct-13 5:57am    
i wrote like that it stops and div is opening but data in div is not loading ....

thanks fr ur suggestion pls tell me alternate sokution..
Wombaticus 16-Oct-13 6:07am    
You need to pass your values as paramaters to the openpopup function, not as the CommandArgument, which is not relevant here.
teja sai ravi 16-Oct-13 6:30am    
here iam loading all the values but div is not staying its loading with values but disappearing very fastly...i want to stop page reloading whrn div is open...pls
Wombaticus 16-Oct-13 6:41am    
You most likely have an error in your javascript then
teja sai ravi 16-Oct-13 6:49am    
no errors in javascript friend i did just open my popup div by javascript loading data by onrowcommand event of gridview .. div is loading with values in rowcommand event but page is also reloading then it come to previous state div is disappearing..
If U use ModalPopupExtender for popup Then use following code on GridView_RowCommand event at last

mdlPopup.Show()

also remove following code from your link button of grid
PostBackUrl="#" OnClientClick="openpopup('popup1')"
 
Share this answer
 

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