MVC: How To Get The Previous Action Name

May 6, 2010

I can get the current action name by using the following code

var currentActionName = ControllerContext.RouteData.GetRequiredString("action");

but is it possible to get the previous action name as well?

View 1 Replies


Similar Messages:

When User Back Any Previous Tab(page) The Will Be Show The Previous Data Without Loading 2nd Time?

Jul 26, 2010

I am developing a web application in ASP.NET3.5 with C#. I also using Telerik RadAjax Control. When user click the menu then open the page with a new tab(Like web Browser).I want to create, when user back any previous tab(page) the will be show the previous data without loading 2nd time( like browser tab). Is it Possible ?

View 2 Replies

Forms Data Controls :: When Use The Previous Button To Navigate Back To The Previous Step The Page Reloads But At The Bottom Of The Page?

Aug 2, 2010

I'm using a wizard control with 4 steps, when I use the previous button to navigate back to the previous step the page reloads but at the bottom of the page.Instead of showning the whole of the page, the user views the footer of the site and the previous button and next button.I'm sure there is a very simple answer to this but I just can't figure out how to get the page to reload to the top.

View 8 Replies

MVC :: Why Synchronous Action Wasn't Executed Until Asynchronous Action Completed

Nov 29, 2010

I'm implement Comet in Asp.net MVC, I used timer to keep Async request in server, Async request will complete when timer elapsed 1 minute and response to client (to avoid 404 error) and then reconnect to Async Controller. I also wanna execute some Synchronous action during Async request was holding, but the problem is: When an Async action was executed and hold by using timer, the Sync Action wasn't called until Async action (comet long-live request) completed. I did test with firefox 3.6 many times, but the result is the same, so strange, Do you know why ? I have a sub some questions : To implement comet, using timer (response after some minutes elapsed) or thread (response after several time sleeping thread) to hold async request, which is better?

View 1 Replies

MVC :: Redirect Action Not Working In Jqgrid Action Results Method

Mar 23, 2011

I am desiging a master and details page from a search page..user can search for something and I need to display the result in jqgrid if the result has more than 1 row or record.. if the result is just one record then i have to directly send then to details page by skiping grid page... I do have an action method for results page and one more action method for Jqgrid data..i am trying to check the row count for the database result and trying to redirect to details action results..but its not working at all..and showing an empty jqgrid..

[Code]....

View 9 Replies

Test That A Controller Action Simply Returns A Link To Another Action?

Apr 29, 2010

Lets say I have a simple controller for ASP.NET MVC I want to test. I want to test that a controller action (Foo, in this case) simply returns a link to another action (Bar, in this case).How would you test TestController.Foo? (either the first or second link)

My implementation has the same link twice. One passes the url throw ViewData[]. This seems more testable to me, as I can check the ViewData collection returned from Foo(). Even this way though, I don't know how to validate the url itself without making dependencies on routing.The controller:

public class TestController : Controller
{
public ActionResult Foo()[code].....

View 1 Replies

MVC :: Create Action Not Carrying Model Across To Http Action

Jun 12, 2010

My httppost action doesnt seem to have received my model. The code is below;

[Code]....

i put a breakpoint on the line; return RedirectToAction("Error", "Dashboard"); and i found that appQualif carried no values whatsoever from the form i submitted..

View 5 Replies

Javascript - How To Go Back To Previous Page While Retaining The Previous Page Data

Jan 5, 2011

I am having problem while using onclick="javascript:history.back();" with Aspnet. In the first page i filled some data and click search button it show some results, i click on particular result for its details which navigate to the 2nd page but when i click on custom back button it refresh the page and all data set to initial values,when i use onclick="javascript:history.back();" I get nothing but the page displays "webpage has expired."

View 1 Replies

How To Pass Parameters To An Action Using Html.Action() In MVC?

Jun 30, 2010

I've been using Html.Action("ActionName", "ControllerName") to invoke child actions across controllers without needing to have the view in ViewsShared. This has been working great for displaying things like session or cookie information.

Instead of just accessing cookies, I would like to pass additional parameters to Html.Action("ActionName", "ControllerName") so the action can execute different code based on the the data passed to the original view.

Should I be using a different method to pass parameters to a child action in a different controller?

View 1 Replies

MVC :: Controller Invokes GET Action Instead Of POST Action

May 20, 2010

I'm trying to add file upload functionality to a page. I've got a form that posts the selected file to a controller with a 'savefile' method. But if I don't add a get version of 'savefile' I'll get a 404 error. Here is the form code which is presented on the Index page:

[Code]....

And here is the controller code:

[Code]....

Intuitively I don't think I should need a GET version of SaveFile but if omit it I get a 404 error when the form posts. Why should I need a GET version of SaveFile when all I want is to post a form and save the file?

View 4 Replies

MVC :: Dynamically Adding Action Filter To Action?

Jun 21, 2010

Does any one know how to dynamically add ActionFilter to an Action?

View 3 Replies

MVC :: Determine Which Action Invoked Particular Action?

Nov 12, 2010

I have a controller with a bunch of actions as such:

[Code]....

I'm looking for a way to find out which action invoked the other: for instance, when redirecting to Action1, I need to know whether it is coming from clicking "next" button at Action0 or clicking "back" button at Action2. This is is to avoid performing Action1 twice (My app is like a wizard, if I click back button at Action2, I don't want to execute Action1 again).

View 1 Replies

How To Tell Create Button To Send To An Action Named Create And To Edit To An Action

Mar 14, 2010

I'm a newbie into MVC and I am like only on chapter 7 in ASP.NET MVC Unleashed so be easy with m

[Code]....

how do I tell Create Button to send to an Action named Create and to Edit to an Action named Edit on the same form?I guess it is possible on ASP.NET MVC if it is possible on ASP.NET Webforms

View 6 Replies

MVC :: How To Call One Action From Another Action

Mar 31, 2010

I have a view MemberProfile like this

<% using (Html.BeginForm()
)
{ %>
<fieldset>
<p>FirstName :<%=Html.TextBox("FirstName", Model.FirstName) %></p>
<p>Last Name : <%=Html.TextBox("LastName", Model.LastName)%></p>
[code]...

View 1 Replies

MVC :: How To Redirect From Action To Another Action

Feb 3, 2011

I have a page with three partial views. On the first ascx, I want some data posted when a user clicks on "submit" button, and send that data to another POST action "search" and search the db with that data, the final output should be the view returned by "search". How do I do this?

View 3 Replies

MVC :: Action Method Returning An ActionResult Used In A Action Method?

Aug 27, 2010

I have the Index action method calling a method that itself is an action method.

Example :

[Code]....

What to do in this case ?

View 10 Replies

C# - Get A Previous Page Value?

Aug 5, 2010

Using C#, I want to get a value from previous page. For example, In a page A i have the textbox value like "apple", i want to get the same value in page B Page A Code.

<a href="javascript:void(0)"
onclick="window.open('pageB.aspx',
'Add','width=700,height=400')">
Add</a>

Above Code is linking a Page B from Page A How to get a value page A textbox value in Page B.

View 3 Replies

C# - Get Previous Day Using Datetime?

Mar 22, 2010

I want to set a DateTime property to previous day at 00:00:00. I don't know why DateTime.AddDays(-1) isn't working. Or why DateTime.AddTicks(-1) isn't working. First should this work?

I have 2 objects. Each object have DateTime fields ValidFrom, ValidTo.

EDIT: After coming home from work I tried to get the same behavior as my business objects behave. Below are the code I tried to replicate how it looks at work. Of course this is working at home but not at work. The good thing is I got good answers and +1 on all! =)

public class RuleValue
{
public DateTime ValidFrom, ValidTo;
public RuleValue(DateTime _validFrom, DateTime _validTo)
{

[Code]....

View 5 Replies

Know Previous URL Without Using URLReferrer?

Sep 16, 2010

I am developing a .net website using Visual Studio 2008.

Now this webpage should be open only from link available on other website. User should not be able to type the URL directly in browser and should not be able to open this way directly. When user logs in to other website, there is a link for my website and when user clicks on that link, then only my website should be opened up.

Now, I can not use "Request.UrlReferrer" because it is not 100% correct way as there are many ways that URLReferrer can be blocked by browser or by some antivirus or etc, so I cannot use URLReferrer on my webpage to check from where this page is opened up.

Now my question is what is the best way to check on my webpage that my site has been opened up only from that source? I can also pass some querystring from that website but I am not sure how can I make sure that my webpage opens up only from that source, not when user directly types URL in the browser.

View 5 Replies

Web Forms :: How To Get Previous Page Value

Sep 19, 2010

my login page contains username and password field. when the user name is correct then the page will be redirected to Default.aspx page...for that i am using Response.redirect("Default.aspx") page is redirecting correctly. but wat the pbm is the username should be displayed in Default.aspx page after redirecting.....for displaying it i am using

Label4.Text = CType(PreviousPage.FindControl("TextBox1"), TextBox).Text in Default.aspx.....

but the vale of TextBox1 in login.aspx page is not displaying in Default.aspx page.

View 2 Replies

Web Forms :: How To Get The Previous Page Name

Apr 12, 2010

i am getting previous page name from

Request.UrlReferrer.ToString()

but not able find name how can i do this

View 5 Replies

How To Access The Previous Page URL

Mar 19, 2010

I need to access the previous page URL but because I am using a MasterPage, I am having difficulty achieving this.

Request.UrlReferrer

This only returns the URL of the current page.

View 1 Replies

Maintaing Changes On The Previous Page?

Jan 4, 2011

I have a page in asp.net by clicking on the grid in the page it takes me to the detail page,on this page i have a back button (not browser back) by clicking on the button it takes me again to the search page. i want to see the page with changes which i have made before coming to the detail page,also i want to disable back button of browser. i dont want to use session variable or viewstate variable. is there any property for this scenario.

View 3 Replies

MVC :: Remember Previous Locations?

Jun 3, 2010

My MVC 2 app is somewhat complicated in that a user can reach different parts of the site in different ways

How can i add a "back" link so that it remembers where it came from?

View 2 Replies

Get Previous Page URL From DNS Redirect?

May 18, 2010

how to get the full URL from a page the was redirected from a DNS redirect? I'm using ASP.net 2.0 with C#.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved