Get parameter

Hello,

I have the following url:

http://localhost:2920/Account/Activate/f585f104-4d38-4d1d-972b-c177b7f64463?Key=0E0CEB5E671A256BAFF8C609CFB3D34F

Account is the controller, Activate the action, "f585f104-4d38-4d1d-972b-c177b7f64463" the id.

How do I get the value of Key on my action code? The following is my current action code:

   public ActionResult Activate(Guid id) {
' ...
return View();
}

Thanks,

Miguel 

 

0
shapper
11/12/2008 1:43:24 AM
asp.net.mvc 4300 articles. 0 followers. Follow

3 Replies
857 Views

Similar Articles

[PageSpeed] 3

 

Request["Key"]
  
0
zsuzen
11/12/2008 2:09:12 AM

Just add it as a parameter to your action method, just like you did with id:

public ActionResult Activate(Guid id, string key) { ... }

0
levib
11/12/2008 2:36:05 AM

If key can be specified only by get parameter then I would prefer Request.QueryString["key"]. Request["key"] looks into server variables and cookies and it could be security issue...

But adding new parameter (to action method) with name key is cleaner way and I recommend it too.


Don't forget to click "Mark as Answer" on the post that helped you.
0
Augi
11/12/2008 7:11:57 AM
Reply:

Similar Artilces:

How do I get the parameter for the delete command when I get the parameter for the select in another way?
I'm working with VS 2008.  I've got a data grid control, which I populate through a DropDownList that is data bound using a stored procedure.  When the DDL changes it updates the contents in the DataView control.  The DataView control is also data bound, and is populated using its own stored procedure and the code returned from the DDL once the user selects something.  I've got another stored procedure assigned to the DeleteCommand of the SqlDataSource, which I intend to use is with a delete CommnadField of the DataView control.  However, in this case I w...

How to get parameter in url ( by C# for .net)
  I would like to get parameter of ASP.NET script in URLexample : /localhost/example.asp?parameter1How can i to get this parameter ? can you give me a example? ( using C#) Thanks a lot   JC To get a querystring you can use the Request.Querystring property: Request.Querystring("parameter1")/Fredrik Normén - fredrikn @ twitterMicrosoft MVP, MCSD, MCAD, MCTASPInsidersMy Blog Actually in C# it would be://this takes request parameters only from the query string Request.QueryString["parameter1"]; //this one works for bot - form and query string Request["paramet...

How to get MVC.NET to work on shared host?
Hi, I am not sure what I need to tell my host in order to run an MVC.NET application on their server. I tried simply publishing it, but I got an error. My host support said to simply change the 3.6.0.0 version to 3.5.0.0 in the web.config file. I tried this and this did not work. I was told by my host that .NET 3.5 was installed. I am not sure what to tell them to do in order to allow MVC.NET applications to run. Thanks in advance   They'll need to download and install the asp.net extentions.http://www.asp.net/downloads/3.5-extensions/ However, it's likely ...

New to MVC & MVC.net
Hi, I have never used the MVC design pattern before and the same applies for the new mvc.net. I have been working with ntier all the time. Where should i start to learn mvc and hence mvc.net so that i can use it in my software projects and have more grasp on it. Thanks. Sultan   Hi, start by taking a look at the videos here: http://www.asp.net/learn/3.5-SP1/. The ones about MVC and MVC storefront. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons. I'd start with ScottGu's blog: http://weblogs.asp.net/sco...

.net web service doesn't seem to get parameters from soap::lite
I'm using the method outlined in http://msdn.microsoft.com/en-us/library/ms995764.aspx, and also I have tried other methods on the web to call my vb.net (3.5) webservice. I can call any method that doesn't take parameters and that works fine. I can call my Authorize method which is used to authorize a credit card from a vb.net windows forms application. I can tell it isn't receiving any parameters because when I put the web service into debug, and set a break point I see all the parameters listed as nothing. This coding is really test coding I am using to verify proof of ...

I am not getting my mail open on my net as net is running
Name: Email: rmbala91atgmaildotcom Product: Firefox Summary: I am not getting my mail open on my net as net is running Comments: My mail is not getting opening. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

IE (6 & 7) iFrame Querystring Parameters Set In .NET MVC Page Not Working, Seemed Stripped, But Appear In Tact On Page Source
We're using .NET MVC, and we're trying to dynamically (through the controller) set the iFrame's URL. This worked fine on FireFox and Chrome, but not Ie. On Ie only the first case site lets the user log through correctly. The v10 and v9 sites don't. All sites use querystring params to log in. Their source looks like this (unsuccessful source in IE) - no visible difference. * Also, we tried that whole IE7 Security setting Enabled for navigating to frame within another domain - that wasn't the problem; it still doesn't work. Also doesn't work on IE6. Same results ...

How to get RS (From VB6) to .NET (VB.NET)
Hi Friends,         I have requirement, there is one function in VB6 it returns a RS, I need to call that function in  VB.NET, how to get those values into .NET, if can any body can help (pass me some code snippets), that will be greate, Thank you.Madhu... -Madhu hey guys i got this one just by using fill method.-Madhu...

Getting error in Net::SFTP with get function
------=_Part_7028_3315294.1193837808284 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi All, I have the following code as part of my program; print "---=========> $file, $localFile\n"; $sftp -> get( $file, $localFile ) || warn("errrrr0rrrrr _---> $!".$sftp->status."\n");^M Even though it has downloaded the file properly, it is giving the following message: ---=========> /trading/tiscrdenhlist10310000.txt.old, /export/home/crdadm/rajeev/tiscrdenhlist103...

POST GET GET GET GET... WTH?
Hi, I'm at a loss to explain this... I have an ASPX page that I can't always navigate to. When I developed the app (it's Starter Kit Portal-based), I did it on my LAN and have had no trouble accessing the page. However, upon deployment, I see the following behavior: 1. POST request goes out looking for MyForm.aspx 2. GET request for MyForm.aspx 3. GET request for MyForm.aspx 4. ... X. GET request Sometimes, the page finally loads. Other times, it just ends up blank. Many times, it doesn't load at ALL the first POST - I just get a "The pa...

does the order of adding parameters matter when using parameters in .net
string sql = "update mytable set nameField = :nameparm where keyField = :keyparam"; updateCMD.CommandText = sql; with the above update statment the following order of adding parameters doesn't work in .NET 2.0 updateCMD.Parameters.Add(keyparm); updateCMD.Parameters.Add(nameparm); while the following works updateCMD.Parameters.Add(nameparm); updateCMD.Parameters.Add(keyparm); why does index of Parametercollection matters when it is going to be matched by name parameter? what will happen in the following scenario. "update mytable set ...

Getting parameters
Hi, I run my mozilla application with a shortcut like this: mozilla.exe -chrome chrome://myapp/content/ is it possible to get the arguments in the command line? For example if I run my application in this way: mozilla.exe -chrome chrome://myapp/content/ param1 param2 can I get "param1" and "param2" ? Thanks, Lithian. Lithian wrote: >I run my mozilla application with a shortcut like this: > >mozilla.exe -chrome chrome://myapp/content/ > >is it possible to get the arguments in the command line? For example if I run my application ...

.Net MVC
 Any advantage on the .Net MVC? Thanks BillwWebhost4lifeQuality Hosting, Quality Performance, Quality Pricing!Best Asp.Net Hosting! If you mean what are the advantages of ASP.Net MVC over the standard WebForms model, here's my list:Testability - Since your logic is within a standard .Net class (the Controller) you can test it by just constructing a new instance of that class and calling the method.  Sure, it gets a little more complex in more advanced scenarios, but I still find it much easier than testing WebForms appsStrong Separation of Concerns - In MVC, the framework g...

MVC is only for .Net 3.5? Is it not available for .Net 2.0?
Hello. I´m new to MVC and I want to try it.. My fist question is: MVC is only for .Net 3.5? Is it not available for .Net 2.0?Thanks!  You could get it to run on 2.0: http://www.hanselman.com/blog/DeployingASPNETMVCOnASPNET20.aspx, but you would be better advised to get 3.5 SP1.  It is free, after all.  So is Visual Web Developer Express, so you can play with it. Regards Mike [MVP - ASP/ASP.NET]My site ASP.NET MVC distributed assemblies reference System.Core.dll assembly from .NET FW 3.5 so you need .NET FW 3.5 to run ASP.NET MVC.Don't forget to click &qu...

[PATCH] Net::FTP
I'm playing around with fetching things from the CPAN shell here. We have an FTP and an HTTP proxy here. While stepping through things in the debugger, I notice that Net::FTP::new loads $fire from $arg{Firewall} || $ENV{FTP_FIREWALL} || $NetConfig{ftp_firewall} || undef; $fire_type is initialised similarly but %NetConfig is not consulted. Is this deliberate? If not, I suggest the following patch: --- /home/pne/tmp/install/perl-5.8.0/lib/Net/FTP.pm Sat Jun 1 19:03:20 2002 +++ /home/pne/lib/perl5/5.8.0/Net/FTP.pm Tue Jan 28 11:29:10 2003 @@ -70,6 +70,7 @@ delete $arg{Po...

Web resources about - Get parameter - asp.net.mvc

Parameter - Wikipedia, the free encyclopedia
A parameter (from the Ancient Greek παρά , "para", meaning "beside, subsidiary" and μέτρον , "metron", meaning "measure"), in its common meaning, ...

fb_source Parameter - Facebook-Entwickler
This document lists the complete list of values for the fb_source parameter that is returned with th...

Google / Firefox Parameter - Flickr - Photo Sharing!
HS what? www.seroundtable.com/archives/017105.html

Cat 8: TIA performance standards committee chairman previews parameters of forthcoming twisted-pair cable ...
Category 8, the next-generation twisted-pair cabling specification, is still in development, but the outlook looks quite positive that it will ...

Philippine president asks for 'parameters' of Mayon Volcano tours
Philippine president asks for 'parameters' of Mayon Volcano tours People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, Apr, May, ...

Alternatives to boolean parameters
... ) { PrintLine ( item . Name ); if ( printDetails ) { PrintLine ( item . Description ); } } } Aha! Now can see that the boolean parameter ...

Exporting Error (Error in Parameter...: Apple Support Communities
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability ...

Apple tech monitors device aging, adjusts operating parameters to ensure optimal performance
... describing a method of monitoring the aging of a device's electronics, comparing the data with a global average and modifying operating parameters ...

Is it poor programming practice to pass parameters as objects?
... a free, community-powered network of 100+ Q&A sites . Risser asked: So, we've got a guy who likes to write methods that take Objects as parameters, ...

Parameter Short Film Competition sponsored by Grolsch
Grolsch presents Parameter The A.V. Club Short Film Competition Please Enter Your Date of Birth Ineligible entry Enter For people over the age ...

Resources last updated: 1/22/2016 4:35:56 AM