如何将 ashx 用于代码后面定义的 html 图像?
当我在后面的代码中定义 HTMl 图像时,ashx 处理程序显示图像时遇到问题。如果我在 ascx 中定义,则图像会被拉得很好,但如果我在 .cs 中定义,则图像不会被拉得很好。
这就是我
HtmlImage img1 = new HtmlImage();
img1.Src = "imageout.ashx?PageID=" + PageID.ToString() + "&DIImageID=" + DIImageID.ToString();
在图像的地方显示 src“imageout.ashx?.......”的文本的方式,
我在这里缺少什么?帮帮我吧。
提前致谢
I have an issue with ashx handler for showing image when i defined HTMl image in code behind. IF i define in ascx, the image is pulled fine but not if i define in .cs.
This is the way i
HtmlImage img1 = new HtmlImage();
img1.Src = "imageout.ashx?PageID=" + PageID.ToString() + "&DIImageID=" + DIImageID.ToString();
In the place of the image, it displays the text of src "imageout.ashx?......."
What is it i am missing here? Help me out.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试
这对我有用。
Try
This works for me.
试试这个
技巧在于 ResolveClientUrl 方法调用。使用 String.Format 方法只是为了增加可读性。
用于用户控制:
Try this
The trick is in the ResolveClientUrl method call. String.Format method has utilized just for increase readability.
For use in user control: