嗨我正在通过asp.net Ajax加载巨大的数据按钮单击网格视图显示加载消息更新prgress ...在更新进度时我必须禁用我的BtnLoadReport按钮.
<td>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:UpdateProgress ID="updProgress"
AssociatedUpdatePanelID="UpdatePanel1"
runat="server" oninit="updProgress_Init" onprerender="updProgress_PreRender">
<ProgressTemplate>
<span style="color:green; font-style:italic;">Loading, please wait...</span>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div id="DemoId">
<asp:Button ID="BtnLoadReport" runat="server" onclick="BtnLoadReport_Click"
Text="LoadReport" Width="176px" ClientIDMode="Static" OnClientClick="return clickOnLoadReport();" />
</div>
<asp:GridView ID="GridView1" runat="server" Height="170px"
onselectedindexchanged="GridView1_SelectedIndexChanged" Width="438px">
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="BtnLoadReport" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
我的脚本禁用按钮
<script type="text/javascript">
var updateProgress = null;
function clickOnLoadReport() {
// …Run Code Online (Sandbox Code Playgroud) 我正在研究MVC4应用程序(Razor引擎).当我尝试从按钮调用js函数时,它会说错误: -
未终止的字符串常量

但它没有给出任何compile time或runtime错误,并且工作正常.
但是在那里可以清楚地看到上面提到的错误:
为什么会这样?
我已经开始学习了ASP.Net MVC,关于MVC framework[客户端或服务器端]我有几个问题。你可能会觉得这些问题很愚蠢,但我真的很困惑,想澄清我的疑虑。
这里是....
ASP.Net MVC,它是服务器端还是客户端框架?
假设我的控制器方法从 获取数据SQL Server,我将其转换为JSON并更新MVC view,在这种情况下
A. 它被称为客户端数据绑定还是服务器端绑定?
B. 在使用控制器方法从数据库中检索数据时,我是获取整个 HTML 以及响应中的数据还是仅获取我请求的数据?
在ASP.Net,假设我在按钮单击事件时在数据库中插入数据,如果我没有错,在这种情况下,它会将整个页面提交给服务器,按钮单击事件如何工作ASP.Net MVC?
我也读过我们可以使用Angular.JS或knockout.JSwith ASP.Net MVC,如果我们使用它,有什么目的Angular.JS或knockout.JS会解决什么问题ASP.Net MVC?
问候
嗨我有两个JS函数:
$('button').click(function() 内 $(document).ready
$(document).on('click','button', function()
第二个功能是为动态生成的按钮设计.我遇到的问题是,当我单击与第一个功能关联的按钮时,第二个功能也会被触发.我怎么能避免这个?
PS:因为我给每个按钮命名并且这个冲突根本不影响功能,但我认为一次点击触发两个功能不是很聪明:(
我有gridview,我在后端使用存储过程.问题是我没有使用任何文本框或仅标签gridview.
当我运行我的代码时,它显示一个编译错误,spproduct1期望参数@id,这是预期不提供的.你能解决这个错误吗?
public partial class WebForm1 : System.Web.UI.Page
{
string _strsql = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
string cs = ("Data Source=172.16.6.173;Initial Catalog=servion_hari;User ID=sa;Password=Servion@123");
_strsql = "select * from tblproduct where id=@id and Name=@Name and Description=@Description";
SqlConnection con = new SqlConnection(cs);
con.Open();
SqlDataAdapter da = new SqlDataAdapter("spgetproducts1", con);
SqlCommand cmd = new SqlCommand();
SqlParameter id = new SqlParameter("@id", SqlDbType.Int.ToString());
id.Value = GridView1.ToString();
da.SelectCommand.CommandType = CommandType.StoredProcedure;
con.Close();
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
} …Run Code Online (Sandbox Code Playgroud) asp.net ×2
c# ×2
javascript ×2
angularjs ×1
asp.net-ajax ×1
asp.net-mvc ×1
c#-4.0 ×1
gridview ×1
jquery ×1
razor ×1