Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi searched in the internet bt nothing works fine for me please help me.. i am binding some values in a terlik grid. values are site name and point name .here i want pass the ids of this 2 values(siteid,pointid)to the second page.aspx when a button is clicked. but that should not be displayed .using responce .redirect how can i send those ids ids are coming from d database itself.pls look up my code

i want to send these ids to the next page



ASP.NET
<table width="100%">
            <tr>
                <td style="width: 100%;">
                    &lt;telerik:RadGrid ID="grdPointSearch"  runat="server"  AutoGenerateColumns="False"  EnableEmbeddedSkins="False" EnableHeaderContextFilterMenu="True" EnableHeaderContextMenu="True" Height="121px" Skin="NGN_Grid" Width="100%"&gt;
                     
                        <mastertableview autogeneratecolumns="False" clientdatakeynames="sitename" datakeynames="sitename,pointname">
                            <columns>
                               
                                
                                <telerik:gridboundcolumn datafield="SiteName" headertext="Site Name" itemstyle-cssclass="fntn fntrd tal" readonly="true" uniquename="SiteCode" xmlns:telerik="#unknown">
                                </telerik:gridboundcolumn>
                                <telerik:gridboundcolumn datafield="PointName" headertext="Point Name" itemstyle-cssclass="fntn fntrd tal" readonly="true" uniquename="PointName" xmlns:telerik="#unknown">
                                </telerik:gridboundcolumn>
                                
                               <telerik:gridboundcolumn uniquename="PointId" datafield="PointId" display="false" xmlns:telerik="#unknown"> </telerik:gridboundcolumn>
                                <telerik:gridboundcolumn uniquename="SiteId" datafield="SiteId" display="false" xmlns:telerik="#unknown"> </telerik:gridboundcolumn>

                               

                          <telerik:gridtemplatecolumn uniquename="TemplateColumn" headertext="Responce" xmlns:telerik="#unknown">
                       <itemtemplate>
                           <table>
                               <tr>
                               </tr>
                               <tr>
                                   <td>
                                       &lt;telerik:RadButton ID="btnviewdtls"  runat="server" ButtonType="LinkButton" Text="View Details"
                                           CommandName="Button1Click" /&gt;
                                   </td>
                                  


                             
                            </tr></table></itemtemplate></telerik:gridtemplatecolumn></columns>
                        </mastertableview>
                        <clientsettings>
                            <clientevents />
                        </clientsettings>
                    
                </td>
            </tr>
        </table>


////clikevent

  protected void ViewDetail_Click(object sender, EventArgs e)
        {
            ////Response.Redirect("SPMPointDetails.aspx", false);

            Response.Redirect("/SPMPointDetails.aspx?" +Siteid,pointid );
        }

<pre lang="HTML">
Posted
Updated 24-Feb-16 23:53pm
v4
Comments
dan!sh 25-Feb-16 5:42am    
It should not be displayed in URL?

1 solution

Your database query needs to return these fields with other required data. When you are doing data binding, make sure these values are assigned to grid columns. You can set visible to false to avoid displaying it.

When the page redirection happens, you can get the values from the hidden columns. Then, you can send these values to other page either using query string or using session.
 
Share this answer
 
v2
Comments
[no name] 25-Feb-16 5:55am    
i coudnt access the data in aspx.cs
dan!sh 25-Feb-16 6:31am    
Updated the response.
[no name] 25-Feb-16 7:12am    
<telerik:gridboundcolumn datafield="PointId" display="false" uniquename="PointId" headertext="Point Id">

cant aces id


Response.Redirect("SPMPointDetails.aspx?PointId=" +Pointid );
[no name] 25-Feb-16 7:26am    
given as point id hidden colomn

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