开发者

MVC2 page not being update

In my page (which displays a list of information), I call a webapage that gets user information and then calls a webservice and a a stored proc for a database on a page (the stored proc inputs or updates a row of data in the db). WHen I click submit, the page is supposed to completely reload the first page with the new updated data and display it to the user. Well, the data does submit to the db, and service, but my page reloads with the old information for some reason, even though I make a call to the entire action that generated the first page. If I navigate back to the home 开发者_如何学运维page and then go to the page in question, the data does appear. Should I be waiting or something to call this action again or something?

I do in fact have

    [OutputCache(CacheProfile = "ZeroCacheProfile")]

attribute peppered on my actions and in my web.config. Am I missing something? Are there any catches places where I should be carefull when doing this? I actually recall the entire action that creates the first page.


If you're returning a view directly from the post it may be using the old data. Try redirecting to the GET action to show the results.


This seems to work right now.

    Random number = number Random();
    RedirectToAction("Action", "Controller", new { value1 = number.Next(0, 100)});

I will go with it for now.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜