“错误加载页面" MVC4移动网站中出现错误,在Razor视图中出现回发问题 [英] "Error Loading Page" error in MVC4 Mobile Website, issue with postback in Razor view

查看:74
本文介绍了“错误加载页面" MVC4移动网站中出现错误,在Razor视图中出现回发问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在开发一个用于移动设备的MVC4网站(使用Razor View Engine).我在创建回发时遇到问题.

我尝试使用以下代码在页面上放置输入按钮:

Hi all,

I am developing a MVC4 website for mobile (using Razor View Engine). I am having problem in creating postback.

I have tried to put Input buttons on page using following code:

@{
    ViewBag.Title = "TestView";
}

<h2>TestView</h2>
@using (Html.BeginForm("TestView", "Sell"))
{
    <input type="submit" value="Cancel" name="action" />
    <input type="submit" value="Create" name="action" />
}
    <input type="submit" value="test" name="action" />


但是,如果我单击Begin.Form中的按钮",则会收到错误加载页面"错误.
如果我单击外面的按钮,则什么都不会发生.

有人可以在这方面帮助我吗?

另外,如果有人知道如何将ViewData文本显示为Div的内部HTML?

谢谢
Ashish


But I get "Error Loading Page" error, if I click Buttons inside Begin.Form.
If I click the button outside nothing happens.

Can anyone help me in this regard?

Also, If anyone know how to Display ViewData Text as Div''s Inner HTML?

Thanks
Ashish

推荐答案

解决方案是我创建了新项目,并将代码合并到新项目和Bingo中.

但是我找不到第一个项目的行为的原因.
但是无论如何,我的项目已经开始处理回发.
The solution was I created the new project and merged the code in new project & bingo It worked.

But I couldn''t findout the reason for that behaviour of first project.

But anyway my project has started handling the post-backs.


这篇关于“错误加载页面" MVC4移动网站中出现错误,在Razor视图中出现回发问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆