我们如何在ASP.NET mvc框架中将数据从一个视图传递到另一个视图(How we can pass data from one view to another in ASP.NET mvc framework)
我有一个页面(视图),并在提交i转移控制到另一个页面(视图),我想要一些值填入第一个视图转移到下一个。 我们如何在ASP.NET MVC中实现这一目标?
I have a page(view) and on submit i transfer control to another page(view) and i want some values which was filled in first view to transfer to next. How we can achieve that in ASP.NET MVC?
原文:https://stackoverflow.com/questions/6464595
最满意答案
我找到了解决方案,我认为这是一个常见的问题。 所以这就是你的应用程序如何拥有自己的音量,而不是弄乱用户的铃声音量,即使你只是将声音作为系统声音播放。
你必须导入AVFoundation框架并在一个对象中保持加载,你的应用程序运行的全部时间(或视图或应用程序委托)你已初始化AVAudioPlayer,给它一个文件来播放并将其设置为“prepareToPlay”它。 ..
这是我在我的主View中所做的(用于将其他视图作为子视图加载):在头文件中:
#import <AVFoundation/AVFoundation.h> @interface MainViewController : UIViewController { AVAudioPlayer *volumeOverridePlayer; } @property (nonatomic, retain) AVAudioPlayer *volumeOverridePlayer;
在实现文件中:
@synthesize volumeOverridePlayer; - (void)viewDidLoad { [super viewDidLoad]; volumeOverridePlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"something" ofType:@"caf"]] error:nil]; [volumeOverridePlayer prepareToPlay]; //... }
只需让玩家准备好播放你的文件,享受自己的音量控制,而不必通过它播放声音! 当然,记得以dealloc发布它。
I have found the solution to what I thought would be a common problem. So here is how your app can have its own volume, and not mess with the user's ringer volume, even if you are only playing sounds as System Sounds.
You have to import the AVFoundation framework and in an object that stays loaded the whole time your app runs (or view, or the app delegate) you have initialize a AVAudioPlayer, give it a file to play and set it to "prepareToPlay" it...
This is what i did in my main View (that is used to load other views as subviews): in the header file:
#import <AVFoundation/AVFoundation.h> @interface MainViewController : UIViewController { AVAudioPlayer *volumeOverridePlayer; } @property (nonatomic, retain) AVAudioPlayer *volumeOverridePlayer;
In the implementation file:
@synthesize volumeOverridePlayer; - (void)viewDidLoad { [super viewDidLoad]; volumeOverridePlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"something" ofType:@"caf"]] error:nil]; [volumeOverridePlayer prepareToPlay]; //... }
Just leave the player prepared to play your file and enjoy your own volume control without having to play the sounds through it! And of course, remember to release it in dealloc.
相关问答
更多-
我第二次评论弗兰克克鲁格和wkw。 从用户体验的角度来看,这听起来像是一个非常糟糕的主意。 如果你想尝试它,你可以试试这个: MPMusicPlayerController *musicPlayer = [MPMusicPlayerController iPodMusicPlayer]; [musicPlayer beginGeneratingPlaybackNotifications]; 当音量改变时,系统现在将生成一个MPMusicPlayerControllerVolumeDidChangeNoti ...
-
Apple拥有封闭的生态系统。 您无法在应用内更改设备设置。 你可以控制的只是你的应用程序音量设置。 或者您可以询问用户,提供一个很好的UI来手动静音设备。 但你绝对不能改变系统铃声音量。 Apple has a closed ecosystem. You cannot change device settings within a app. All you can control is your apps volume settings. Or you can ask user, provide a ni ...
-
如何在android中以编程方式增加铃声和通知音量(How to increase the ringer & notification volume programmatically in android)[2023-09-06]
更换线路 mobilemode.setStreamVolume (AudioManager.STREAM_MUSIC,mobilemode.getStreamMaxVolume(AudioManager.STREAM_MUSIC),0); 与下面的线 mobilemode.setStreamVolume(AudioManager.STREAM_RING,audioManager.getStreamMaxVolume(AudioManager.STREAM_RING),0); Replace the li ... -
它不是内置控件,但有一个开源项目( http://github.com/matej/MBProgressHUD ),它创建了一个圆角半透明视图。 虽然用于显示进度,但可以进行调整。 这需要一些修补,但希望这是一个正确的方向。 It's not a built-in control, but there is an open source project (http://github.com/matej/MBProgressHUD) which creates a rounded translucent vi ...
-
我认为你应该使用100%的当前音量状态。 这就是iPhone的人机界面指南 。 I think you should use 100% of the current volume state. Here it goes, the iPhone Human Interface Guidelines for volume.
-
我找到了解决方案,我认为这是一个常见的问题。 所以这就是你的应用程序如何拥有自己的音量,而不是弄乱用户的铃声音量,即使你只是将声音作为系统声音播放。 你必须导入AVFoundation框架并在一个对象中保持加载,你的应用程序运行的全部时间(或视图或应用程序委托)你已初始化AVAudioPlayer,给它一个文件来播放并将其设置为“prepareToPlay”它。 .. 这是我在我的主View中所做的(用于将其他视图作为子视图加载):在头文件中: #import经过一些研究和测试后,我发现只有在接入呼叫检测的早期阶段才能实现音量变化。 在onReceive()方法中做很多操作至关重要。 public class CallReceiver extends BroadcastReceiver { private boolean isRinging = false; private boolean isInProgress = false; private Listener mListener = null; // interface declaration ...
在ios中使用AVSystemController获取铃声音量(get ringer volume level using AVSystemController in ios)[2023-07-06]
尝试这个: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volumeChanged:) name:@"AVSystemController_SystemVolumeDidChangeNotification" ...原来,这可以通过为AVAudioPlayer分配任何有效的声音文件并调用prepareToPlay方法来完成,而不必调用play方法。 完美的作品。 Turns out this can be accomplished by allocating an AVAudioPlayer with any valid sound file and calling the prepareToPlay method, without ever calling the play method. Works perfect ...使用以下代码将允许用户调整播放音量而不是铃声。 AVAudioSession *session = [AVAudioSession sharedInstance]; [session setCategory:AVAudioSessionCategoryPlayAndRecord error:nil]; Use the following code will allow user to adjust the volume of play instead of ring tone. AVAudioSessio ...相关文章
更多- Chapter 9 - Securing Your Application -- Professional ASP.NET MVC 1.0
- AMF: ASP.NET Mobile Framework
- Ubuntu(Linux) + mono + jexus +asp.net MVC3 部署
- asp.net mvc 微信开发随笔(1)
- ASP.NET MVC4 微信公众平台开发测试一: 验证
- [c#]asp.net开发微信公众平台(2)多层架构框架搭建和入口实现
- 微信开发订阅号(ASP.NET MVC4+jquery mobile+AppHarbor发布)
- 微信.NET 微信开发 自动内容回复 ASP.NET C#代码
- asp.net 列表控件
- asp.net 输出微信自定义菜单json
最新问答
更多- sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
- 如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
- AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
- Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
- 湖北京山哪里有修平板计算机的
- SimplePie问题(SimplePie Problem)
- 在不同的任务中,我们可以同时使用多少“上下文”?(How many 'context' we can use at a time simultaneously in different tasks?)
- HTML / Javascript:从子目录启用文件夹访问(HTML/Javascript: Enabling folder access from a subdirectory)
- 为什么我会收到链接错误?(Why do I get a linker error?)
- 如何正确定义析构函数(How to properly define destructor)
- 垂直切换菜单打开第3级父级。(Vertical toggle menu 3rd level parent stay opened. jQuery)
- 类型不匹配 - JavaScript(Type mismatch - JavaScript)
- 为什么当我将模型传递给我的.Net MVC 4控制器操作时,它坚持在部分更新中使用它?(Why is it that when I pass a Model to my .Net MVC 4 Controller Action it insists on using it in the Partial Update?)
- 在使用熊猫和statsmodels时拉取变量名称(Pulling variable names when using pandas and statsmodels)
- 如何开启mysql计划事件
- 检查数组的总和是否大于最大数,反之亦然javascript(checking if sum of array is greater than max number and vice versa javascript)
- 使用OpenGL ES绘制轮廓(Drawing Outline with OpenGL ES)
- java日历格式(java Calendar format)
- Python PANDAS:将pandas / numpy转换为dask数据框/数组(Python PANDAS: Converting from pandas/numpy to dask dataframe/array)
- 如何搜索附加在elasticsearch索引中的文档的内容(How to search a content of a document attached in elasticsearch index)
- LinQ to Entities:做相反的查询(LinQ to Entities: Doing the opposite query)
- 从ExtJs 4.1商店中删除记录时会触发哪些事件(Which events get fired when a record is removed from ExtJs 4.1 store)
- 运行javascript后如何截取网页截图[关闭](How to take screenshot of a webpage after running javascript [closed])
- 如何使用GlassFish打印完整的堆栈跟踪?(How can I print the full stack trace with GlassFish?)
- 如何获取某个exe应用程序的出站HTTP请求?(how to get the outbound HTTP request of a certain exe application?)
- 嗨,Android重叠背景片段和膨胀异常(Hi, Android overlapping background fragment and inflate exception)
- Assimp详细说明typedef(Assimp elaborated type refers to typedef)
- 初始化继承类中不同对象的列表(initialize list of different objects in inherited class)
- 使用jquery ajax在gridview行中保存星级评分(Save star rating in a gridview row using jquery ajax)
- Geoxml3 groundOverlay zIndex(Geoxml3 groundOverlay zIndex)