本文介绍了如何使用查询字符串C#ASP.NET将url图像传递给其他页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

listpage:

<%#string.Format(/ Views / Detail.aspx?id = {0}& cars_brand = {1}& cars_type = {2},

HttpUtility.UrlEncode(Eval(id)。ToString()),HttpUtility.UrlEncode(Eval(cars_brand)。ToString()),HttpUtility.UrlEncode(Eval(cars_type)) .ToString())



,HttpUtility.UrlEncode(Eval(cars_img1)。ToString()))

%>' >



DetailPage:

 lblid.Text = HttpUtility.UrlDecode(Request.QueryString [  id]); 
cars_brand.Text = HttpUtility.UrlDecode(Request.QueryString [ cars_brand]);
cars_type.Text = HttpUtility.UrlDecode(Request.QueryString [ cars_type]);
this .img.ImageUrl = 〜 / Content / Img / cars / + Request.QueryString [ cars_img1];





我的尝试:



如何使用查询字符串C#asp.net?

解决方案



listpage:
<%# string.Format("/Views/Detail.aspx?id={0}&cars_brand={1}&cars_type={2}",
HttpUtility.UrlEncode(Eval("id").ToString()), HttpUtility.UrlEncode(Eval("cars_brand").ToString()), HttpUtility.UrlEncode(Eval("cars_type").ToString())

, HttpUtility.UrlEncode(Eval("cars_img1").ToString()) )
%>'>

DetailPage:

lblid.Text = HttpUtility.UrlDecode(Request.QueryString["id"]);
          cars_brand.Text = HttpUtility.UrlDecode(Request.QueryString["cars_brand"]);
          cars_type.Text = HttpUtility.UrlDecode(Request.QueryString["cars_type"]);
          this.img.ImageUrl = "~/Content/Img/cars/" + Request.QueryString["cars_img1"];



What I have tried:

how pass url images to other pages with Query String C# asp.net?

解决方案



这篇关于如何使用查询字符串C#ASP.NET将url图像传递给其他页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 17:11