使用case语句重定向到同一个aspx页面中的选项卡 [英] RedirectTo a tab in the same aspx page using a case statement
本文介绍了使用case语句重定向到同一个aspx页面中的选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含5个标签的页面,其中包含用户填写的字段。当用户在标签之间导航(回发)时,我想保存每个标签中的数据。做这个的最好方式是什么?我试过javascript(这里没有回发)并使用case语句触发的case语句。在第二种方法中,由于某种原因导航没有发生,数据在按钮点击时被清除。
JavaScript方法:
I have a page with 5 tabs on it, containing fields that the user fills out. I would like to save the data from each tab as the user navigates between tabs (postback). What is the best way to do this? I have tried javascript (no postback here) and using a case statement triggered by a case statement. In the second method, for some reason the navigation does not occur and the data is cleared on the button click.
JavaScript method:
$(function () {
$("#<%= btnBack.ClientID%>").css("display", "none");
$("#<%= btnNext.ClientID%>").click(function (event) {
$("#tabIncident").tabs("option", "active", $("#tabIncident .ui-tabs-active").index() + 1);
//event.preventDefault();
});
$("#<%= btnBack.ClientID%>").click(function (event) {
$("#tabIncident").tabs("option", "active", $("#tabIncident .ui-tabs-active").index() - 1);
//event.preventDefault();
});
C#案例陈述方法:
C# Case Statement Method:
switch (e.CommandName)
{
case "BACK":
if (_eventID == 0)
{
Save(false, Mode.Edit, Status.Save);
RedirectTo(pageLocation - 1);
}
else
Update(_eventID, false, Status.Save);
RedirectTo(pageLocation - 1);
break;
case "NEXT":
if (_eventID == 0)
{
Save(false, Mode.Edit, Status.Save);
RedirectTo(pageLocation + 1);
}
else
Update(_eventID, false, Status.Save);
RedirectTo(pageLocation + 1);
break;
推荐答案
( function (){
( #<%= btnBack.ClientID%>)。css( display, none);
("#<%= btnBack.ClientID%>").css("display", "none");
( #<%= btnNext.ClientID%>)。click( function (event){
("#<%= btnNext.ClientID%>").click(function (event) {
这篇关于使用case语句重定向到同一个aspx页面中的选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文