EDIT: it was the #ViewBag.Persona(item.IDPersona) part the problem.
In a view I iterate over a collection of models, each model has an url that corresponds to an image in the server. I want to display in a table every model with its image. So I did something like this:
<table class="tbody">
<tr class="th">
<th>ID
</th>
<th>Person
</th>
<th>Image
</th>
</tr>
#foreach (var item in Model.Entity)
{
<tr>
<td>
#Html.ActionLink(item.IDPersona.ToString(), "Edit", "Persona", new{Id = item.IDPersona}, null)
</td>
<td>
#ViewBag.Persona(item.IDPersona)
</td>
<td>
<img src="/img/#item.ImageName" height="100" width="100" />
</td>
</tr>
}
</table>
But the page can take up to 13 seconds to load. I imagine that the reason is because I am loading one image at a time instead of loading multiple images simultaneously.
Is there a way to improve the loading time? Maybe "delaying" the load of the image until the model have been iterated entirely, is this possible?
Looking at your code, and going off of the details in your comments, I don't think it's the images causing the issue. If it's simply pulling the images off of the local file system it's not likely that they'd be the cause of the slowness.
Related
I have an web page to which I dont have access to the source code. I will need to create an API that will pass auto generated values to the Text box on the page. As I dont have access to the source code of the page, not sure how I will be able to pass the auto generated values through the API.
When I right click I get the source of the field like below
<div class="OneColTable">
<table class="DataInputTable">
<tr>
<td colspan="2"><h3>Enter Project Information</h3><br/></td>
</tr>
<tr>
<tr>
<td class="label">Project name:</td>
<td><input type="text" name="project.name" value="" class="RequiredField"></td>
</tr>
</tr>
I have create an WEb API before but not sure how to approach this scenario. Any help is greatly appreciated.
I've got an assignment from college to do and I've one question.
This is what I am supposed to do:
And the blue border is even. On my site:
It is not. Is there any CSS to make them even ?
<table>
<tr>
<th>Module Description</th>
</tr>
<tr>
<td>The successful learner will, through the use of a realistic commercial scenario, take a project through the software development lifecycle. They must take their project from problem statement through the significant phases of a software project. </td>
</tr>
<tr>
<th>Learning Outcomes</th>
</tr>
<tr>
<td>On a successful completion of this module the learner will/should be able to do...</td>
</tr>
</table>
I didn't know about width="100%" attribute. This was the answer for my question. Sorry for this missleading question :D
I'm a newbie to Spring MVC. Here's my question.
I have a input view where a user can input a name and a text, which will then be displayed like this:
<tr>
<td>Name: </td>
<td>${product.name}</td>
</tr>
<tr>
<td>Text: </td>
<td>${product.text}</td>
</tr>
How can I make the two fields editable for the user? I'd like to place a link or so next to each field, that the user can use for editing entries.
Furthmore, I'd like to link the request to the same page as the input page/form, how can I distinguish the two cases in my controller? I'm using SimpleFormController...
You can use a <a href tag as follows:
${product.text}
Therefore, in your example above, you could use the following:
<tr>
<td>Name: </td>
<td>${product.name}</td>
</tr>
<tr>
<td>Text: </td>
<td>${product.text}</td>
</tr>
Your edit page link urls will have to be the correct link to that edit page.
Alternative:
However, another way to make the fields editable is to use the spring <form> tags as below:
<form:input path="name" placeholder="${product.name}" />
<form:input path="text" placeholder="${product.text}" />
I am using the iframe in asp.net page.Page name is Home.aspx and iframe id name is frame1. I frame have some html design with more header. I want to search the header using quick link.But it's working fine in HTML page not in asp.net page. Please help me to do this..
My code is here..
<tr>
<td>
1. Employment Application
</td>
<td>
2. Transfer and Reassignment
</td>
<td>
3. Non-Discrimination
</td>
</tr>
As Billy Moat said, the problem is likely that you are using spaces in your href attributes for the links. This is not allowed, so you should change your hrefs and the IDs of the elements that they are referencing to not include spaces:
<tr>
<td>
1. Employment Application
</td>
<td>
2. Transfer and Reassignment
</td>
<td>
3. Non-Discrimination
</td>
</tr>
I want to generate a table in following fashion :
<table>
<tbody>
<tr class="folder" style="-moz-user-select: none;">
<td><div><img src="folder.png"><span>home</span></div></td>
<td class="bytes">Folder</td>
</tr>
<tr class="folder hover" style="-moz-user-select: none;">
<td><div><img src="folder.png"><span>share</span></div></td>
<td class="bytes">Folder</td>
</tr>
</tbody>
</table>
I want to add the rows from the CS code depending on the number of entries.
Instead of "adding elements to html table" you should consider using Repeater for data display, which would give you clean html (exactly as you want).
Then on each click you would do what you need to do (code behind) and rebind the repeater.
Hope that helps.
I would agree with Sebastian why not use a repeater or datalist to bind the data. What source are you using to get your data from? If your pulling the data from a SQL table here is a pretty good article on how to get you started.
http://msdn.microsoft.com/en-us/library/aa719636(v=vs.71).aspx