进行自动后备控制值会丢失

编程入门 行业动态 更新时间:2024-10-26 18:25:52
本文介绍了进行自动后备控制值会丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好 我正在vs2015开发一个网站。在一个表单中我有几个下拉列表,选择它们的值会更改表单中的其他值。 问题是当用户登录时这很好用,但是当它不是时,通过制作autopostback控制值丢失。 知道为什么会这样吗? 谢谢 我尝试了什么: 我使用的代码只在加载中运行一次因为我已经放置了条件

Hello I am developing a website in vs2015. In a form I have several dropdownlist that selecting a value on them change other values in the form. the problem is that this works well when the user is logged in, but when it is not, by making autopostback the control values are lost. Any idea why this happens? Thank you What I have tried: the code that I use is only in the load and runs once because I have put conditional

if (!IsPostBack) { }

和dropdownlist控件由ObjectDataSource填充

and dropdownlist controls are filled by ObjectDataSource

推荐答案

你可以使用Ajax @using(Ajax.BeginForm(方法名称,控制器名称, 新AjaxOptions {UpdateTargetId =ur Div Id})) You can Use Ajax @using (Ajax.BeginForm("Method Name", "Controller Name", new AjaxOptions { UpdateTargetId = "ur Div Id" }))

更多推荐

进行自动后备控制值会丢失

本文发布于:2023-11-25 18:34:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630873.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!