Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Saturday, March 24, 2012

passing variables between pages

I have a web app that searches a database and returns a datagrid table.
the user inputs the search terms into a textbox. The user selects the
info he wants and it sends him to a 2nd page, after another selection
it goes to a 3rd page. I have been able to pass the search term in my
textbox back and forth to all the pages using Context.items. Now the
user may click a button that is supposed to take him back to the first
page and reload the original datagrid. How do I get the variable
containing the search terms from the 3rd page back to the 1st page and
automatically perform the search or is there another way to recall the
datagrid? thanks.Why won't you put it in a session variable?

Eliyahu

<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegro ups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
You could session variables (as already mentioned), you could still use
context items provided you know what the originating page was (ie. the fact
it came from the 3rd page). You could use an argument in the URL/query
string to set this. You could also save his info to a database, and use the
query string info to flag a reload of that info from the database.

There are many options.

--

- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)

<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegro ups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.

passing variables between pages

I have a web app that searches a database and returns a datagrid table.
the user inputs the search terms into a textbox. The user selects the
info he wants and it sends him to a 2nd page, after another selection
it goes to a 3rd page. I have been able to pass the search term in my
textbox back and forth to all the pages using Context.items. Now the
user may click a button that is supposed to take him back to the first
page and reload the original datagrid. How do I get the variable
containing the search terms from the 3rd page back to the 1st page and
automatically perform the search or is there another way to recall the
datagrid? thanks.can u keep the search variables in session?
bineesh
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>
Why won't you put it in a session variable?
Eliyahu
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>
You could session variables (as already mentioned), you could still use
context items provided you know what the originating page was (ie. the fact
it came from the 3rd page). You could use an argument in the URL/query
string to set this. You could also save his info to a database, and use the
query string info to flag a reload of that info from the database.
There are many options.
- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)
<lacombpcs@.juno.com> wrote in message
news:1117539066.532083.18140@.g49g2000cwa.googlegroups.com...
> I have a web app that searches a database and returns a datagrid table.
> the user inputs the search terms into a textbox. The user selects the
> info he wants and it sends him to a 2nd page, after another selection
> it goes to a 3rd page. I have been able to pass the search term in my
> textbox back and forth to all the pages using Context.items. Now the
> user may click a button that is supposed to take him back to the first
> page and reload the original datagrid. How do I get the variable
> containing the search terms from the 3rd page back to the 1st page and
> automatically perform the search or is there another way to recall the
> datagrid? thanks.
>

Wednesday, March 21, 2012

Passing variables to SSL page?

What is the best way to send a variable (or two or three) to an SSL page? My app used session variables, but that doesn't work (new session, I suppose). I figured that I would just place the variables into a cookie, but that seemed to not work either, though I can't come up with a reason why not (except programmer error). I have been reduced to using the query string, but is there a better way? Have I given up on my cookie idea too quickly? The page that is protected by SSL is in the same folder as the page that is redirecting to it, if that is important.

Seethis article about Session State in ASP.NET, in the MSDN library. Near the very end of the article is explains about ApplyAppPathModifier, which essentially inserts the SessionID in the URL.
The funny things is that I have used Session between HTTP and HTTPS, in the past, without any problems.

PassingObjectstoWebForms

I have an object that gets created when the first ASP.NET webform, of
the web app, is opened. I need to pass this object to other webforms as
they are opened and keep the scope in the same session. How can I do this?

ThanksHI J,

You can store the object into a Session var and pick it up in following
forms. This works well assuming that the object you are storing is
serializable.

If you're using Server.Transfer() or Server.Excute() you can also use
Context.Items() to store request specific info to pass to transferred pages.

+++ Rick --

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
-----------
Making waves on the Web

"J" <j@.netscape.net> wrote in message
news:ODlq6J5AEHA.3400@.tk2msftngp13.phx.gbl...
> I have an object that gets created when the first ASP.NET webform, of
> the web app, is opened. I need to pass this object to other webforms as
> they are opened and keep the scope in the same session. How can I do
this?
> Thanks

Friday, March 16, 2012

password configuration question

Ok, I took over a web app that is using the login control provided by
asp.net 2.0. In the config file the developers added a param as such:

<machineKey validationkey=" and a hole mess of letters and numbers "
decryptionKey= " again a mess of numbers and letters " validation="SHAI"
/>

then in the membership configuration, it hwas <passwordFormat=encrypted />

I tried to decrypt a password in the test db and it doesn't work, so in this
scenario, how is the password really stored? Is it HASHED or is it encrypted
or what?Machine key does not determine how the info is stored. It is determined by
passwordFormat under the provider used under the MembershipProvider tag
(web.config). You can store as encrypted.

Even if encrypted, not hashed, you have to use question 1 to decrypt the
password, unless you create your own custom provider or do not use a
security question (which may require a custom provider). Since this value is
also encrypted, you have to decrypt it or ask the user, or store somewhere
else (defeating the purpose). Your other option is to reverse engineer MS's
salted encryption scheme. I have partially done this, but it is quite time
consuming, as you end up culling through a lot of source to do this.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
*********************************************
Think outside the box!
*********************************************
"Tom" <Tom@.yahoo.comwrote in message
news:%232ZbeGvcHHA.3408@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

Ok, I took over a web app that is using the login control provided by
asp.net 2.0. In the config file the developers added a param as such:
>
<machineKey validationkey=" and a hole mess of letters and numbers "
decryptionKey= " again a mess of numbers and letters " validation="SHAI"
/>
>
>
then in the membership configuration, it hwas <passwordFormat=encrypted />
>
I tried to decrypt a password in the test db and it doesn't work, so in
this scenario, how is the password really stored? Is it HASHED or is it
encrypted or what?
>
>
>

password configuration question

Ok, I took over a web app that is using the login control provided by
asp.net 2.0. In the config file the developers added a param as such:
<machineKey validationkey=" and a hole mess of letters and numbers "
decryptionKey= " again a mess of numbers and letters " validation="SHAI"
/>
then in the membership configuration, it hwas <passwordFormat=encrypted />
I tried to decrypt a password in the test db and it doesn't work, so in this
scenario, how is the password really stored? Is it HASHED or is it encrypted
or what?Machine key does not determine how the info is stored. It is determined by
passwordFormat under the provider used under the MembershipProvider tag
(web.config). You can store as encrypted.
Even if encrypted, not hashed, you have to use question 1 to decrypt the
password, unless you create your own custom provider or do not use a
security question (which may require a custom provider). Since this value is
also encrypted, you have to decrypt it or ask the user, or store somewhere
else (defeating the purpose). Your other option is to reverse engineer MS's
salted encryption scheme. I have partially done this, but it is quite time
consuming, as you end up culling through a lot of source to do this.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
****************************************
*****
Think outside the box!
****************************************
*****
"Tom" <Tom@.yahoo.com> wrote in message
news:%232ZbeGvcHHA.3408@.TK2MSFTNGP03.phx.gbl...
> Ok, I took over a web app that is using the login control provided by
> asp.net 2.0. In the config file the developers added a param as such:
> <machineKey validationkey=" and a hole mess of letters and numbers "
> decryptionKey= " again a mess of numbers and letters " validation="SHAI"
> />
>
> then in the membership configuration, it hwas <passwordFormat=encrypted />
> I tried to decrypt a password in the test db and it doesn't work, so in
> this scenario, how is the password really stored? Is it HASHED or is it
> encrypted or what?
>
>