How do I pass parameters to a web form without putting them in the querystring?


Author
Message
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi all.

This a a very noobie question, but I do mostly winforms development. I need to create a web page that I can send a link to from my winofrms app. I do not want to put something like this:

?pk=1010&user_id=akinsm

in the URL for obvious reasons. My first impulse when I see things like this is to put in different values and see what I can see Smile

So, I am creating my web page using StrataFrame and I just need to know the best way to pass the parameters when I send the link from my winforms app.

TIA

Marcia
Replies
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (1/4/2012)
You can do it several ways.  You can use a POST operation instead of a GET.  GET operations expose the query string like you mentioned and is more limited in the length.  If you want to use a GET operation, you can encrypt it using the StrataFrame 3DES class or even create a Base64 output.


Hi Trent.

I tried using the 3DES class but when I try to decrypt using this code:

String DecryptedSignOffID = _3des.Decrypt(Request["pk"].ToString());

I wind up with this error instead of the web page:

System.FormatException was unhandled by user code
  Message=Invalid length for a Base-64 char array.
  Source=mscorlib
  StackTrace:
       at System.Convert.FromBase64String(String s)
       at MicroFour.StrataFrame.Security.Encryption.TripleDESWrapper.Decrypt(String text)
       at StlCI_new.EditSignOff.Page_Load(Object sender, EventArgs e) in C:\StlCI_new\StlCI_new\StlCI_new\EditSignOff.aspx.cs:line 25
       at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
       at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException:

Now, the goofy thing is that just for grins and giggle, I tried decrypting the value right after I encypted it like so:

string EncrytedSignOffID = _3des.Encrypt(e.BusinessObject["sign_off_id"].ToString());

string DecrytedSignOffID = _3des.Decrypt(EncryptedSignOffID);

and it was happy as a clam. So apparently, there is an issue trying to decrypt the string when it is used as part of a QueryString, but I have absolutely no idea what the problem could be.

Can you help?

TIA

Marcia
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi all.

I finally got this figured out. All I needed was this on the Decrypt:

String DecryptedSignOffID = _3des.Decrypt(Request["pk"].Replace(" ", "+"));

 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search