如何从SQl Server 2005数据库调用缓存图像? [英] How to cache images from a SQl Server 2005 database call?
问题描述
我在aspnet 2.0页面指令中使用输出缓存参数时遇到问题。我正在使用会话变量来保存所选图像的值。当页面指令中的输出缓存设置为true时,似乎数据列表中的动态控件不起作用。有没有办法单独缓存图像以避免使用页面指令?
datalist code
RepeatColumns =6CellPadding =8CellSpacing =8GridLines =BothSelectedItemStyle-BackColor =#33ff66OnSelectedIndexChanged =dtlImages_SelectedIndexChangedOnItemCommand =dtlImages_ItemCommand>'Runat =server>
'ID =lblDescriptionFont-Bold =True字体大小=12px字体名称=Arial>
$ b从数据库中检索图像的$ b代码
protected void Page_Load(object sender,System.EventArgs e){string strImageID = Request.QueryString [id] ;
I am having trouble using the output cache param in an aspnet 2.0 page directive. I am using a session variable to hold the value of the selected image. It seems that the dynamic control in a datalist, is not working when the output cache is set to true in the page directive. Is there a way to cache the images seperately to avoid using a page directive?
datalist code
" RepeatColumns="6" CellPadding="8" CellSpacing="8" GridLines="Both" SelectedItemStyle-BackColor="#33ff66" OnSelectedIndexChanged="dtlImages_SelectedIndexChanged" OnItemCommand="dtlImages_ItemCommand"> ' Runat="server">
' ID="lblDescription" Font-Bold="True" Font-Size="12px" Font-Names="Arial">
code that retrieves the image from the database
protected void Page_Load(object sender, System.EventArgs e) { string strImageID = Request.QueryString["id"];
推荐答案
你得到的唯一解决方案是你自己写的那个。只是从某个地方拿起代码然后把它打开就是为了得到你失败等级和就业市场完全失败。
至于建议,这是非常直接的东西。如果你好你有这个项目的问题我建议你和你的教授谈谈。
The only "solution" you get is the one you write yourself. Just picking up the code from somewhere and turning it in is just going to get you a failing grade and a complete failure in the job market.
As for suggestions, this is pretty straight forward stuff. If you're having problems with this project I suggest you talk to your prof.
这篇关于如何从SQl Server 2005数据库调用缓存图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!