Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello sir, i have a page that show a grid view and grid view have a

link button
and i have to click that link button that send id of that record then

i have to show other web page which show table's field according to

that id and that page should b open as a popup




thanks in advance
Posted

hi,
this link describes what you want, just pass your ID to the page url as querstring
jQuery popup control
JavaScript
<script type="text/javascript">
        function GoToNextPage(id) {
            $.braviPopUp('testing title!', 'popup.aspx?id=' + id, 600, 400);
        }
    </script>

use this javascript function to call the popup function:

call the function from each gridview row like:
ASP.NET
<asp:GridView ID="GridView1" runat="server">
         <Columns>
             <asp:TemplateField HeaderText="Logged Ticket">
             <ItemTemplate>
             <asp:LinkButton ID=btnview runat=server Text="View Detail" OnClientClick='<%# "return GoToNextPage("+ Eval("ID")+")" %>'>
             </asp:LinkButton>
             </ItemTemplate>
             </asp:TemplateField>
          </Columns>
      </asp:GridView>
 
Share this answer
 
v3
Comments
anshu77 2-Oct-13 2:52am    
but i have to pass send id of the particular row id of the gridview to popup page so that i can access data according to that id and show on this popup
tanweer 2-Oct-13 3:00am    
i have updated my answer, please check now
anshu77 2-Oct-13 3:22am    
ok thanks i implement it
Below link may help you

http://www.dotnetpools.com/Article/ArticleDetiail/?articleId=335&title=Code-To-Display-Gridview-Selected-Row-Value-in-Modalpopupextender-Using-C#-in-Asp.net[^]

or you can use something like this

C#
e.Row.Attributes.Add("onclick", String.Format("javascript:$find('{0}').show();", ModalPopupExtender1.ClientID));
 
Share this answer
 
v2
Add OnItemCommand="grdAppCond_ItemCommand" to Grid Tag on your aspx page. The following method will be invoked. Check that e.CommandName is equal to the text of cell of your grid.

C#
protected void grdAppCond_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == "Open Window")
            {
                this.OpenWindow();
            }
        }

Add the following method to your .cs file. This method will call the javascript funtion openPopup.
C#
private void OpenWindow()
{
string script = "<script language='javascript' type='text/javascript'>openPopup()</script>";
                            ClientScript.RegisterStartupScript(this.GetType(), "openPopup", script);
}

Now in your aspx page add the following code (batter on end).
JavaScript
<script type="text/javascript">
function openPopup() {
            var id = '<%= id%>';
            var url = quot;WindowPath.aspx?ID=quot; + id;
            window.open(url, &quot;window1&quot;, &quot;scrollbars=1, width=950px, height=560px, resizable=0&quot;);

        }
</script>


Now you can get the id on your target page using Query String
 
Share this answer
 
v5

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