Encrypting Querystring values in browser's URL

Posted by Self-innovator under ASP.NET on 1/16/2012 | Points: 10 | Views : 3269 | Status : [Member] | Replies : 2
Hi friends...
How do i encrypt the querystring URL while redirecting to other pages...pls go through my code
Design Page
 <asp:TemplateField HeaderText="Edit">
<ItemTemplate>
<a href="QueryStringApplication.aspx?id=<%#Eval("id") %>">
<asp:Label ID="lblEditt" runat="server" Text="Edit"></asp:Label>
</a>
</ItemTemplate>
</asp:TemplateField>

.cs

//Page Load
if (Request.QueryString["id"] != null)
{
Edits();
}
UDF
protected void Edits()
{
int id = Convert.ToInt32(Request.QueryString["id"].ToString());
SqlConnection cnn = new SqlConnection(Conn);
SqlCommand cmd = new SqlCommand("sp_NameAgeById", cnn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@id", id);
SqlDataAdapter ada = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
ada.Fill(ds);
txtName.Text = ds.Tables[0].Rows[0]["Name"].ToString();
txtAge.Text = ds.Tables[0].Rows[0]["Age"].ToString();
}


Join Hands Change lives
Thanks & Regards
Straight Edge Society



Responses

Posted by: Ujjal on: 1/16/2012 [Member] Starter | Points: 25

Up
0
Down
Hi ,

You can check this link http://www.dotnetfunda.com/blogs/umeshdwivedi/1811/url-encoding-in-a-simple-way

Self-innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-innovator on: 1/16/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi ujjal can provide me any idea according to my code snippet bcoz i've passing the value of id as querystring from .aspx page.


Join Hands Change lives
Thanks & Regards
Straight Edge Society

Self-innovator, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response