MVC: TempData, Once Read Do I Need To Resave

Jan 20, 2010

i am using TempData to store the referrer for a website and via jquery i am issueing ajax calls to send emails ... I use tempdata to recover the original referrer URL.

It works great on the first read but then the second its empty.... I think this is by design... so i decided to try viewdata but this is stored but when read via the controller on an ajax call it is empty..

Does anyone know what my options are?

Here is the syntax of both lines

TempData["referrer"] = referrer; // WORKS great on first read and then is NULL
ViewData["referrer"] = referrer; // IS STORED but on first read is NULL

View 2 Replies


Similar Messages:

MVC 2.0 TempData Expiration?

Jul 3, 2010

What happens in Asp.Net MVC 2.0, when next request does not come ever to retrieve value from TempData. Is it stored permanently or expires?

View 1 Replies

Mvc Viewdata Tempdata Variable?

Jul 29, 2010

tempdata variables works like a session variables?

basically i want to do is to when the form loads for the first time the variables should be empty. but the variable should be persisted until i am on that form.

the form contains searching with a submit button as well as the paging . basically my ques is to use what approach should i use?

View 1 Replies

MVC :: How Long TempData Lives

Feb 21, 2010

I have a method, which fill TempData:

[Code]....

so, I redirected to referrerUrl ([URL] then I even go to page: [URl] (Ideas method does not have any actions with TempData) and then go to [URL]

[Code]....

and it goes to selected by "GO TO HERE!!!" with value [URL]

View 6 Replies

MVC :: TempData Bug In Google Chrome?

Sep 10, 2010

So TempData works on my local machine in chrome, but not out on the server. It works fine in IE and firefox. I'm using the default Session State as InProc. I can see the cookie in chrome by looking at the developer tools.

View 4 Replies

Use TempData With Response.Redirect?

May 21, 2010

I am working with ASP.net MVC 2 framework, for multiple sites. We have a base site and then sub sites that inherit from a "Core" site that contains 90% of the functionality that the sub sites will use.

In one of the controllers, I am saving some data, adding a UI message to the tempData and then using Response.Redirect.

The redirect works, but the tempdata is empty after the redirect.

I have tried returning "RedirectToAction" and "RedirectToRoute" with the same routing location and while it populates the TempData, the redirect doesn't happen lol..

So I guess in short, is there a way to get tempdata working when using a standard Response.Redirect?

View 1 Replies

MVC :: TempData - Is It Controller Specific?

Jun 11, 2010

I was under the impression that TempData was only persisted across one action but I am seem to be seeing the behaviour that it is persisted across one action only on the same controller.For example in a single controller if I do the following in my Event Controller,

TempData("test") = "Moo"

And then after displaying a view I then move to a new action (either by a GET or POST or redirect) I can read back the data,

TempData("test") = "Moo"

If I then move on to another action (either by a GET or POST or redirect) and check for TempData("test") I should get Nothing.However I have just tried this with two controllers and I get a very bizarre problem.For example on my first Controller, called Event Controller I set the TempData("test") = "Moo".I then move to an action on a second controller called Main Controller. I read back TempData("test") and find "Moo" as the result which is to be expected. I then perform some sort of task and a new GET, POST or Redirect request is made back to the Event Controller.

At this point I am expecting TempData("test") to be nothing, since I have already passed it to an action once already. However when I test this I am actually getting TempData("test") = "Moo" which I thought was not the expected behaviour, since in effect it would be like using Session("test) instead.

View 2 Replies

MVC :: Writing To TempData In Unit Test?

Apr 30, 2010

Some of my controller actions look for data in TempData. How can I insert data into TempData from my unit tests?

View 1 Replies

MVC :: Steps To Make TempData Durable Across Web Server?

Jun 5, 2010

We used MVC TempData to store smallish view state prior to redirects. This works worked great on our single Win2008 development server. Unforunately, the use of TempData no longer works in our load balanced production server farm. What steps are required to make MVC TempData durable across web servers?

View 4 Replies

MVC - Webfarm Doesn't Support TempData Session?

Feb 8, 2011

The WebFarm we are using doesn't supports Session. We are in a requirement to pass Data during redirects. How to do this without TempData dictionary since TempData uses Session inside.

View 2 Replies

MVC :: Storing State In 'TempData' When Performing The PRG (Post-Redirect-Get) Pattern?

Jul 29, 2010

I'm learning about storing state in 'TempData' when performing the PRG (Post-Redirect-Get) pattern. It says TempData stores session state on the server. I'm wondering if this is safe or unsafe in a load-balanced server farm?

Are there precautions to be taken with TempData? Or can we happily program against it with abandon. Just wanting to avoid the frights we all got with the Session back in the day with ASP.NET of old.

View 1 Replies

MVC :: Referencing TempData On Master Page Causing Compile Errors?

Jan 29, 2010

Working through Steven Sanderson's excellent Pro ASP.Net MVC Framework book.I am trying to reference the TempData collection to display a message after an item has been successfully updated and so have placed a reference to this on my Master Page.[Code]....


This is giving me the following compile time errors:

Error 1 The name 'TempData' does not exist in the current context <programme location>

Error 2 The name 'TempData' does not exist in the current context <programme location>

If I reference TempData on a content page it compiles (and works) fine.

View 3 Replies

MVC :: Session Vs TempData / How To Persist Values From Controller To Controller

May 30, 2010

I have a filter on my MVC web site. I display some records in a few different controller actions but when moving from one action to another I want to apply those filter values.

How can I persist values from controller to controller?

Should I use Session? TempData?

I am using Structure Map for IOC.

Maybe I could have a class that contains a Property for each Session Value that I use in my application and inject it on the controllers that need session?

View 10 Replies

Web Forms :: Read Receipt And Read Outlook Inbox For The Same

Jul 21, 2010

Read Receipt And Read Outlook Inbox for the same

View 2 Replies

How To Read XML Nodes In XML Using C#

Jun 1, 2010

I have a XML file like below:

<report timestamp="3201" reportVersion="2" request="3981135340">
<question timedOut="false" time="3163" attempts="2" correct="true" id="13">
<answer status="attempt">
<radioButton correct="false" value="true" id="17" />
</answer>
<answer status="correct">
<radioButton correct="true" value="true" id="15" />
</answer>
</question>
</report>

I want to read the child nodes based on 'status' attribute of 'answer' node.

View 4 Replies

How To Read Xml With Jquery

Mar 13, 2011

[code]....

XML files have not read While alert(xml); show XML File

View 1 Replies

How To Read Multilevel Xml In Vb.net

Jul 29, 2010

reading this multilevel xml to a RadGrid. 1) I am planning not to use Aspx for this 2) The node named Item would eventually change as per app Requirements. So, I don't want to restrict my xpath to something like

[code].....

View 1 Replies

Read Data From Pdf?

Mar 9, 2011

I have a pdf and on one of its pages there is a table of data. Is there a way to get specific column of the table?

View 3 Replies

How To Read Pdf File In .net

Jul 27, 2010

I uploaded word doc and internally by using third party tool i converted it to pdf.Now, if i upload pdf file it should save as pdf file.I mean just to read a pdf file.

View 3 Replies

ADO.NET :: How To Read IEnumerable

Mar 6, 2011

I have function it will return IEnumerable as.

IEM = myclass.getdata("name");

How to read the data in IEM as it consists of many columns. I have to display the values into labels and textboxes.

View 3 Replies

How To Read The First Value From JasonArray

Mar 17, 2011

How do i read the first value from jasonArray (if exist ) as i am getting error on fourth line:

[Code]....

I am using vb.net

View 4 Replies

Can Read The Referral URL

Feb 1, 2011

Say there is a link in [URL] that redirects to [URL] website.

How can I capture the referral URL where the link in [URL] came from with my code at [URL]?

View 3 Replies

Read A Value From Html?

Dec 20, 2010

I am new to asp.net. I need to send a value from send.html to get.aspx.cs

In send.html, I have

<a href="<%=var%>">The Link</a>

where the value of var is anotherPage.html

how do I get the value of var from send.html when send.html calls get.aspx?

Many hours spent still can't figure out. I probably could make the url like get.aspx?link=<%=var%>.... and then use Request.QueryString["link"] in get.aspx.cs to retrieve it, but shouldn't there be an easier way to look up the variable in send.html?

View 2 Replies

MVC :: Read A Xml On View?

Oct 18, 2010

I want o create a dropdown menu using jquery.

it was imposed that menu should be loaded from a xml file.i must admit i'm doing it stept by step.

This is XML structure:

[Code]....

On my view i'm trying to show just menu names: <submenu> <title>Estatisticas</title>

How can i do that?

<ul>
<% foreach (System.Xml.XmlDocument doc in (ViewData["xmlDoc"] as IEnumerable<System.Xml.XmlDocument>)) %>
<li> doc. ???? </li>

</ul>
<?xml version="1.0" encoding="iso-8859-1"?>

View 9 Replies

C# - Read Assembly In .net?

May 18, 2010

I am using asp.net with C#. I have a application deployed on the server [published], now I want to see the code for that website, As far as I know I can read assembly to see the code.

View 2 Replies







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