首页 \ 问答 \ asp.net mvc datatable(asp.net mvc datatable)

asp.net mvc datatable(asp.net mvc datatable)

如何将数据表传递给mvc视图

我将如何在视图中迭代它


How can I pass datatable to the mvc view

How would I iterate over it in the view


原文:https://stackoverflow.com/questions/2794831
更新时间:2022-07-11 09:07

最满意答案

在Post man Image Key中是pic但是在你的代码中它的"fileset"

改成

        multipartFormData.append(imageData!, withName: "pic", fileName: "file.png", mimeType: "image/png")

并且success是编码结果不上传过程

EncodingResult是MultipartFormDataEncodingResult,它定义MultipartFormData编码是否成功,并且包含编码结果作为关联值。 - 成功 :表示成功的MultipartFormData编码,并包含新的UploadRequest和流信息。 - 失败 :用于表示MultipartFormData编码中的失败并且还包含编码


In Post man Image Key is pic but in your code its "fileset"

change to

        multipartFormData.append(imageData!, withName: "pic", fileName: "file.png", mimeType: "image/png")

And success is Result of encoding not uploading processs

EncodingResult is MultipartFormDataEncodingResult that Defines whether the MultipartFormData encoding was successful and contains result of the encoding as associated values. - Success: Represents a successful MultipartFormData encoding and contains the new UploadRequest along with streaming information. - Failure: Used to represent a failure in the MultipartFormData encoding and also contains the encoding

相关问答

更多
  • 阅读更多关闭: [__NSCFDictionary setObject:forKey:]:尝试插入nil值(key:target) 您正在尝试将NIL设置为某个字典对象。 我们无法使用错误日志在您的代码中找到此位置。 还要检查是否将所有参数正确设置为您正在使用的对象(您可以在堆栈跟踪中看到其中的几个)。 其中一些可能发生异常。 *更新:当我看到这些行: 5 ContactExplorer 0x00021990 -[PGFileTransfer createFile ...
  • 例如,在Swift 3中使用Alamofire 4.0.0 : (确保你是4.0.0准备好,因为它看起来像你还没有更新你的Alamofire) Alamofire.upload(multipartFormData: { (multipartFormData) in // code }, to: URL, encodingCompletion: { (result) in // code }) 要么 Alamofire.upload(multipartForm ...
  • 你可以这样做: Alamofire.upload( .POST, URLString: "http://httpbin.org/post", multipartFormData: { multipartFormData in multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") multipartFormData.appendBodyPart(fileUR ...
  • 这是iOS 8上的一个错误,当webview以模态方式呈现时会发生这种错误。 现在唯一的选择就是不要以模态方式呈现webview,你可以用导航控制器或切换rootviewcontroller来呈现它 在这里,您可以阅读有关错误和建议解决方案的更多信息 iOS 8 SDK:模态UIWebView和相机/图像选择器 It's a bug on iOS 8, that happens when the webview is presented modally. The only options right now ...
  • 我相信你需要以这种方式追加图像 multipartFormData.append(imageData!, withName: "profile_image", fileName: "image.jpg", mimeType: "image/jpeg") 而且您不需要设置或包含parameters = ["profile_image": "image file"] 正如@rob提到的那样,使用Charles并将Postman的请求与模拟器的请求进行比较。 这将有助于查明有什么不同 I ...
  • 尝试从目录中的UIImagePickerController保存选定的图像 func saveUserProfileAtDirectory (userImage : UIImage) -> NSURL { let documentsDirectoryURL = try! NSFileManager().URLForDirectory(.DocumentDirectory, inDomain: .UserDomainMask, appropriateForURL: nil, create: ...
  • 在Post man Image Key中是pic但是在你的代码中它的"fileset" 改成 multipartFormData.append(imageData!, withName: "pic", fileName: "file.png", mimeType: "image/png") 并且success是编码结果不上传过程 EncodingResult是MultipartFormDataEncodingResult,它定义MultipartFormData编码是否成功,并且包含编码结 ...
  • 我只是能够让这个工作。 事实证明,你必须使用Alamofire指定fileName和mimeType,以便multer在服务器端获取上传。 因此,添加图像的代码应如下所示: if let image = image { if let imageData = UIImageJPEGRepresentation(image, 0.5) { multipartFormData.appendBodyPart(data: imageData, name: "file", fileName: " ...
  • 我有同样的问题,这就是我解决它的方式 var parameters = [ [ "name": "tdd_form", "value": "test" ], [ "name": "id", "value": "\(self.inventoryDeviceVal.recId!)" ] . . ...
  • NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://upload.uploadcare.com/base/"]]; UIImage *image = [UIImage imageNamed:@"image.jpg"]; NSData *imageData = UIImageJPEGRepresentation(image, 1.0); ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。