I set content type but there is no affect , content type always return "application/json" and i can not change it.
One thing that i think is for my source control software. I am using SourceSafe 2005, Can source safe change file content or content type?
There is another project like this under TFS 2008 and it work without any problem. I think there is a problem in source control software but what, I do not know!!!!
Is you add the above code(including Response.End)?
This is not related to Source Safe,
"And whoever is removed away from the Fire and admitted to Paradise, he indeed is successful." (The Holy Quran)
Excellent Windows VPS Hosting Imran Baloch MVP, MVB, MCP, MCTS, MCPD
mahdiit
Member
5 Points
8 Posts
Re: [Problem] Asp.net MVC Postback always show savefile dialog!
May 04, 2010 04:28 AM|LINK
I set content type but there is no affect , content type always return "application/json" and i can not change it.
One thing that i think is for my source control software. I am using SourceSafe 2005, Can source safe change file content or content type?
There is another project like this under TFS 2008 and it work without any problem. I think there is a problem in source control software but what, I do not know!!!!
imran_ku07
All-Star
45815 Points
7698 Posts
MVP
Re: [Problem] Asp.net MVC Postback always show savefile dialog!
May 04, 2010 04:44 AM|LINK
Is you add the above code(including Response.End)?
This is not related to Source Safe,
Excellent Windows VPS Hosting
Imran Baloch MVP, MVB, MCP, MCTS, MCPD
mahdiit
Member
5 Points
8 Posts
Re: [Problem] Asp.net MVC Postback always show savefile dialog!
May 04, 2010 05:01 AM|LINK
My problem solved and i found reasons.
Lets describe problem and solution:
I am using some partial rendering in my page. for example there is a poll on master page. Result with fix
public ActionResult Polls() { BLL.Pool api = new DPMS.BLL.Pool(); DAL.TbPool pl = api.FindActivePool(); ViewData["ShowResult"] = false; bool sl = false; if (!string.IsNullOrEmpty(Request.QueryString["show"])) sl = true; if (pl != null) { ViewData["POLL"] = pl; HttpCookie HC = Request.Cookies["Poll_" + pl.PoolId.ToString()]; if (HC == null && !sl) { pl.TbPoolDatails.Load(); List<DAL.TbPoolDatails> dt = pl.TbPoolDatails.ToList(); ViewData["DT"] = dt; } else { ViewData["ShowResult"] = true; int tt; List<BLL.Pool.PollResult> dt2 = api.Result(pl.PoolId.ToString(), out tt); ViewData["DT"] = dt2; } } return View(); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Polls(FormCollection FormData) { if (Request.IsAjaxRequest()) { BLL.Pool api = new DPMS.BLL.Pool(); ClientResult ct = new ClientResult(); string pl = FormData["pl"]; if (!string.IsNullOrEmpty(pl)) { string pid = FormData["pid"]; if (!string.IsNullOrEmpty(pid)) { api.UpdatePoolCount(pl, pid); HttpCookie hp = new HttpCookie("Poll_" + pl); hp.Expires = DateTime.Now.AddDays(7); hp.Value = "Sample_Test"; Response.Cookies.Add(hp); ct.success = true; } } return Json(ct); } else return Polls(); }I am using Request.IsAjaxRequest to check.
But becuase this is partial rendering i can not find this. Thanks all from help