.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

please check the code

Posted By: Nabin     Posted Date: August 27, 2009    Points:2   Category :ASP.Net
In the product page i m sending page address with the required id like that:-
Response.Redirect("product_detail.aspx?cid=" + intCid + "&prodid=" + intProdid);

in the product detail page m getting that ids like that.so how can i apply that server.URLRncode and Server.URLDecode to this. please help

intCid = int.Parse(Request.QueryString["cid"].ToString());
intprodId = int.Parse(Request.QueryString["prodid"].ToString())



thanks
Nabin

Responses
Author: Akhil Raj       [Moderator]      
Posted Date: August 27, 2009     Points: 5   

if you want to use UrlEncode just pass the values as string..Just look at the following

Response.Redirect("product_detail.aspx?cid=" + Server.UrlEncode(intCid.ToString()) + "&prodid=" + Server.UrlEncode(intProdid.ToString()));


in the destination form:

intCid = int.Parse(Server.UrlDecode(Request.QueryString["cid"].ToString()));
intprodId = int.Parse(Server.UrlDecode(Request.QueryString["prodid"].ToString()));

Author: Nabin             
Posted Date: August 27, 2009     Points: 5   

Hi Akhil
Thanks for reply. But it dont work. it also displays the original id inthe url, which i dont want. Please Give some code for it if u have




thanks
Nabin

Author: Amit Mehra             
Posted Date: August 27, 2009     Points: 5   

Hi Nabin,

check this code sample to encrypt and decrypt the query string

http://www.dotnetspark.com/kb/512-encryption-and-decryption-with-querystring.aspx

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: Akhil Raj       [Moderator]      
Posted Date: August 27, 2009     Points: 5   

hi friend...that code working for urlenocde and urldecode.. so u need to encrypt for that please follow the link given by amit mehra

Author: Nabin             
Posted Date: August 27, 2009     Points: 5   

Thanks Akhil

Thanks Amit

I'll try this


Nabin



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend