Hi akhter,
Use encoding QueryString to get your data.
Refer below sample.
HTML
Home.aspx
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="150" />
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# string.Format("~/Details.aspx?Name={0}",
HttpUtility.UrlEncode(Eval("Name").ToString()) )%>' Text="View Details" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Details.aspx
<asp:Label ID="lblName" runat="server"></asp:Label>
Namespaces
C#
using System.Data;
VB.Net
Imports System.Data
Code
C#
Home.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.Add("Name");
dt.Rows.Add("HAT-K # 01");
dt.Rows.Add("HAT-K # 02");
dt.Rows.Add("HAT-K # 03");
dt.Rows.Add("HAT-K # 04");
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
Details.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
lblName.Text = HttpUtility.UrlDecode(Request.QueryString["Name"]);
}
VB.Net
Home.aspx.vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim dt As DataTable = New DataTable()
dt.Columns.Add("Name")
dt.Rows.Add("HAT-K # 01")
dt.Rows.Add("HAT-K # 02")
dt.Rows.Add("HAT-K # 03")
dt.Rows.Add("HAT-K # 04")
GridView1.DataSource = dt
GridView1.DataBind()
End If
End Sub
Details.aspx.vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
lblName.Text = HttpUtility.UrlDecode(Request.QueryString("Name"))
End Sub
Screenshot