asp.net Ïà¹ØÎÊÌâ - .NET¼¼Êõ / ASP.NET
Êý¾Ý¿âÖÐÓиöimg×ֶΣ¬img¿ÉÒÔÊÇÈÎÒâ¶à¸öͼƬÃû³Æ¡ÀýÈ磺aa.jpg£¬bb.jpg,cc.jpg¡
csÎļþÖÐÒ»¸ö·½·¨£º
public static string getPic(object o, int i)
{
string tmp = o.ToString();
string [] pic=tmp.Split(',');
return pic[i];
}
aspxÖаó¶¨:
<img src="backend/UploadFiles/<%#getPic((DataBinder.Eval(Container.DataItem,"ImgName")),0)%>" alt="soft">
°ó¶¨ÎªµÚÒ»ÕÅͼƬ¼´aa.jpg£¬ÇëÎÊÔõôµã»÷imgÈ»ºó¾ÍÏÔʾbb.jpg,ÔÙµãÏÔʾcc.jpg¡ÒÔ´ËÀàÍÆ¡
¿ÉÒÔÕâÑù£¬ÔÚcsÉèÖÃÒ»¸öÈ«¾Ö±äÁ¿£¬Ã¿µã»÷Ò»´Î¾Í¼ÓÒ»
getpic¸ù¾ÝÕâ¸öÈ«¾Ö±äÁ¿£¬È«²éѯ¶ÔÓ¦µÄͼƬ
onclickÖÐÐÞ¸ÄhidenfieldÒþ²ØÓòÖµ
ͨ¹ýÒþ²ØÓòȡֵ
var i=parseInt(document.getElementById("hf").value);
¶¨ÒåÒ»¸öÈ«¾Ö¾²Ì¬±äÁ¿£º
public static int n=0;
È»ºóÿ´ÎclickʼþÖУº
{
getPic(o, n)£»//´«Èën£»
n++£»//µã»÷ºó¾²Ì¬n×Ô¼Ó1
}
Â¥Éϼ¸Î»µÄ·½·¨¶¼²»Ì«Ã÷°×£¬Çë¸øµãÏêϸ´úÂëºÃÂð?
ÁíÍ⣬ÎÒ×Ô¼º¾õµÃÕâÑù¿ÉÒÔ¡²»¹ý£¬³ö´íÁË£¬´ó¼Ò¸ø¸Ä¸Ä¡
function bb(var i)
{
i++;
return i;
}
<img src=
"backend/UploadFiles/
<%#getPic((DataBinder.Eval(Container.DataItem,"ImgName")),bb(0))%>"
alt="soft"/>
¸ø¸Äϰɡ
Ó¦¸ÃÊÇIȡֵµÄʱºò³öÏÖÁËÎÊÌâ¡£¡£¡£
Ò²¿ÉÔÚgetPicÖÐ
ʹÓÃÄǸö
Ïà¹ØÎÊ´ð£º
http://www.zgjhjy.com/Test/PrimaryTest/Index.aspx
¾ÍÊÇÀàËÆÒÔÉϵÄÔÚÏß²âÊÔϵͳ£¬ÐèÒªÓÐÒ»¸öºǫ́µÄ£¬ÓïÑÔÊÇaspµÄ£¬Êý¾Ý¿âÊÇaccessµÄ£¬»¹ÐèÒªÄÜÔÚºǫ́¶ÔÐÅÏ¢½øÐÐÌíɾ¸Ä²éµÄ¡£Ð»Ð»¸÷λÁË¡£¡£¡£
³ÌÐòÕæµÄºÜ¶à£¬²»Öª ......
ÍòÍøµÄ·þÎñÆ÷Ö§³Öα¾²Ì¬µÄ,Ö±½ÓÓÃrewriteÔÚweb.configÎļþд¹æÔò,Ò²²»Óð²×°×é¼þ¾Í¿ÉÒÔʵÏÖα¾²Ì¬,µ«ÊÇÔÚʱ´ú»¥Áª·þÎñÆ÷¾ÍÓò»ÁËÁË,×ÉѯËüµÄ¿Í·þ,Ëû˵ËûÃÇ·þÎñÆ÷(»ù±¾ÐÍC)²»Ö§³Öα¾²Ì¬µÄ.ÇëÎÊһϸ÷λÎÒ¸ÃÓÃʲô·½·¨ ......
¾ÍÊÇÒ»¸ö°´Å¥£¬µã»÷Ö®ºó´ò¿ª¶Ô»°¿ò£¬È»ºóѡȡͼƬ¡£¾ÍÕâÑùÉÏ´«¡£¡£
ÔõôʵÏÖ¡£ÔÚÍøÉÏËѵ½ÄÇô¶àµÄ´úÂ룬ȫÊǺܶàµÄÄÇÖÖ£¬²»ÖªµÀ£¬¿´²»ÏÂÈ¥¡£
ËùÒÔÔÚÕâÀïÏëÇë´ó¸ç´ó½ã°ï°ïæ¡£
ʹÓÃ×Ô´øµÄfileupload¿Ø¼þ¿ÉÒÔʵÏÖ ......
ÎÒÓÐÁ½¸ödropdownlist¶¼°óºÃÁËÖµ£¬ÏëÑ¡ÖÐÒ»¸ödropdownlistÖеÄÖµ£¬È»ºóÔÚÁíÒ»¸ödropdownlistÖÐÑ¡ÖÐÏàÓ¦µÄÒ»Ïî¡£
²»ÊÇ´Óа󶨵ڶþ¸ödropdownlist£¬ÊÇÔÚÒѾ°óºÃµÄÖµµ±ÖÐÑ¡ÖÐÒ»¸ö¡£
ÎÒÏëÓÃjsд
ÇóÖú
Äã¿ÉÒÔ°Ñdrop ......
¹ØÓÚÍøÕ¾°²È«µÄÎÊÌ⣡
ÎÒÁ˽⵽µÄÍøÕ¾°²È«ÎÊÌâ°üÀ¨£º
sql×¢Èë©¶´ºÍ±©¿â©¶´»¹ÓÐÉÏ´«Â©¶´
³ýÁËÕâЩ»¹ÓÐÆäËûµÄ©¶´Ã´£¿
×¢Èë©¶´¿ÉÒÔͨ¹ý¹ýÂËÀ´·ÀÖ¹
±©¿â©¶´Ôõô·ÀÖ¹
»¹ÓÐÈËÉÏ´«µÄľÂíÊÇ.gif
ÕâÖÖ©¶´Ôõôȥ± ......