Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Input type Submit?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
magic kat - 02 Aug 2007 21:07 GMT
What's the equivalent in asp.net for the old "form method=post" using the
submit.  I want to redirect to another page with parameters, but I don't
want the parameters to be displayed in the url.  So I want to pass
ClientName and ClientCompany to
www.mySite.com\p.asp?ClientName=John&ClientCompany="JDCo"

but I only want to display in the address bar www.mySite.com/p.asp
dotnet_coder - 03 Aug 2007 01:02 GMT
There are several ways to do this. One way is, put a ASP.NET Button
control on your page and then in the click event you could create
sessions and assign the parameters to the sessions. Then you would
response.redirect to the new page and check for the sessions.

Here is example code for the button click event (in C#):

--------
Session["MyParam1"] = "Hello";
Session["MyParam2"] = "World";

Response.Redirect("p.asp");
----------

Then to read the parameters on the receiving page you would do the
following to write them out on the screen:

----------------
string sParam1 = Session["MyParam1"].ToString();
string sParam2 = Session["MyParam2"].ToString();

Response.Write(sParam1 + " " + sParam2);
----------------

Result on Screen: Hello World

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.