webForumDet fria alternativet

"Fånga" variabel som loopas fram i DataGrid?

.NETur .NET

0 svar · 153 visningar · startad av CokeLight

Medlem sedan juni 2000504 inlägg
Frågan#1

Hejasan, det är if satsen jag har problem med, då jag inte vet hur jag lagrar {0} i en variabel som jag vill använda...?

if(!cl.isPublicServer())
{
	HyperLinkColumn hcPhoto = new HyperLinkColumn();
	hcPhoto.HeaderText = "Foto";
	hcPhoto.DataNavigateUrlField = "Foto";
	hcPhoto.DataNavigateUrlFormatString = "javascript:showImage('{0}');";
	hcPhoto.DataTextField = "foto"; 

	//[B]string photoName = {0};[/B] // --> Här blir det fel alltså... 

	//if(cl.FileExist("images/thumbNail", photoName, "jpg"))
		hcPhoto.DataTextFormatString = "<img src='images/thumbnail/{0}' border='0' width='18' height='22'>";
	//else
	//	hcPhoto.DataTextFormatString = "<img src='images/Genomskinlig.gif' border='0' width='18' height='22'>";
	
	hcPhoto.SortExpression = "foto";
	this.dgAllStaff.Columns.Add(hcPhoto);

	this.dgAllStaff.DataSource = dtc.CreateDataSource(this.getSpName(), this.RequestLetter, this.SortCriteria, this.SortDir);
	this.dgAllStaff.DataBind();
}
132 ms totalt · 3 externa anrop · v20260731065814-full.b746b907
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
129 ms — hämta tråd, inlägg och bilagor (db)