Image not displaying in my view while another image is - image

I have read a lot of solutions to image problem but none of them are working for me and I can't figure out where I'm going wrong. I've an ASP.Net MVC 4 project I'm working on and all I wanted to do is add an image to one of the views. In this same view is already an image that displays perfectly fine.
Here is some of the code for non-working image:
#Scripts.Render("~/Scripts/Page/QueryForm.js")
<img id="searchPic" src="#Url.Content("~/Images/NereusSearchLogo-small.jpg")" alt="Pic"/>
<input list="RecentQueries" name="q" value="#(Model.SearchResults == null ? string.Empty : Model.SearchResults.Query)" autocomplete="off"/>
<datalist id="RecentQueries">
#{
foreach (var query in Model.RecentQueries)
{
<option value="#query.Text">#query.LastUsed.ToLocalTime()</option>
}
}
</datalist>
<button type="button" id="search">Search</button>
<button type="button" class="hasTooltip" id="new-project-search" title="Start a new search project">New Project Search</button>
Here is the code for the working image:
<span id="search-period-dd" data-dropdown="#search-period-menu" data-horizontal-offset="-8">
<img src="#Url.Content("~/Images/arrow_down-grey-16.png")" class="hasTooltip" title="Filter search results based on date" />
<span id="search-period">#(Model.StartDate == null? Model.SearchPeriodOption.GetAttribute<DisplayAttribute>().Name : "Since " + Model.StartDate.Value.ToLocalTime().ToString("d"))</span>
Here is the html generated:
<img id="searchPic" src="/Images/NereusSearchLogo-small.jpg" alt="Pic"/>
<input list="RecentQueries" name="q" value="" autocomplete="off"/>
<datalist id="RecentQueries">
<option value="Mice">8/7/2013 3:57:38 PM</option>
<option value="Deer">8/7/2013 1:12:49 PM</option>
<option value="Pigs">8/7/2013 12:22:29 PM</option>
<option value="Cats">8/7/2013 9:23:59 AM</option>
<option value="Dogs">8/7/2013 9:23:56 AM</option>
<option value="Birds">8/7/2013 9:23:48 AM</option>
</datalist>
<button type="button" id="search">Search</button>
<button type="button" class="hasTooltip" id="new-project-search" title="Start a new search project">New Project Search</button>
<link href="/Content/Common/ThirdParty/jquery.dropdown.css" rel="stylesheet"/>
<link href="/Content/Page/SearchPeriodDropdown.css" rel="stylesheet"/>
<script src="/Scripts/Common/ThirdParty/jquery.dropdown.js"></script>
<script src="/Scripts/Page/SearchPeriodDropdown.js"></script>
<span id="search-period-dd" data-dropdown="#search-period-menu" data-horizontal-offset="-8">
<img src="/Images/arrow_down-grey-16.png" class="hasTooltip" title="Filter search results based on date" />
<span id="search-period">Any time</span>
</span>
The image is physically in the correct directory, and has been added to the project under the Images folder.
When I inspect the element with Chrome there is no warning/error.
Any help would be greatly appreciated as I am at my whit's end as to why this keeps showing a broken image icon.
Edit Update:
I've confirmed that both images are in the same file location. Both have been added to the project under the same folder. When hovered over in Visual Studio (2012) both images show up. Both have the same full path value (minus their names of course) under the Properties tab when selected in Visual Studio (2012). However, if I swap their names within the code the problem image still doesn't show up and the good one does. I just don't know why at this point. Thanks for all your help.

Danrhul was correct. It was the company's filter. I just changed the file type to png and all is working.

Related

Ruby selenium webdriver. Can't navigate to dropdown and choose item from it

Most of the solutions for this issue represenred as this
drowpdown = driver.find_element(:id, 'option1')
option = Selenium::WebDriver::Select::Support.new(dropdown)
option.select_by(:value, "x")
But in my case website that i'm testing doesn't have regular "dropdown" and "options".
what i'm facing here
<div class="sk-select"><input maxlength="" type="text" value="" class="sk-select__typing-input"> <!----> <span class="sk-select__value" title="Select a language">Select a language</span> <span class="sk-select__arrow"></span> <!----></div>
example of html
Before click on the dropdown section
<div class="sk-select"><input maxlength="" type="text" class="sk-select__typing-input"> <!----> <span class="sk-select__value" title="Select a language">Select a language</span> <span class="sk-select__arrow"></span> <!----></div>
<span class="sk-select__value" title="Select a language">Select a language</span>
After click on the dropdown
<div class="sk-select is-opened"><input maxlength="" type="text" value="" class="sk-select__typing-input"> <!----> <!----> <span class="sk-select__arrow"></span> <ul class="sk-select__list"><li class="sk-select__list-item js-list-item">Afrikaans<span class="sk-select__sub-value">The language is not listed in the National Interpreter Register</span>
<span class="sk-select__arrow"></span>
I think what you want to do is to do two clicks one to get the dropdown list to appear and one to select a particular item on the dropdown list. If you are using Ruby I would suggest using the Capybara gem to drive interactions with your web site. With this the approach for making a selection would be something like
find('.sk-select').click
find('.sk-select__list.js-list-item', text: item_text).click
if you just wanted to click on say the first item you could use
all('.sk-select__list.js-list-item').first.click
find and all are methods provided by Capybara.

Python/Plone: Getting all keywords and showing for EDIT content is very slow

Python/Plone: Getting all keywords and showing for EDIT content is very slow (keywords.pt)
No of keywords is 20000 so traversing these huge no of keywords is taking one minute.
Keywords which no has grown large is taking time....any solution is welcomed
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="plone">
<head><title></title></head>
<body>
<!-- Keyword Widgets -->
<metal:view_macro define-macro="view"
tal:define="kssClassesView context/##kss_field_decorator_view;
getKssClasses nocall:kssClassesView/getKssClassesInlineEditable;">
<div metal:define-macro="keyword-field-view"
tal:define="kss_class python:getKssClasses(fieldName,
templateId='widgets/keyword', macro='keyword-field-view');
uid context/UID|nothing"
tal:attributes="class kss_class;
id string:parent-fieldname-$fieldName-$uid">
<ul metal:define-slot="inside">
<li tal:repeat="item accessor"
tal:content="item"/>
</ul>
</div>
</metal:view_macro>
<metal:define define-macro="edit">
<metal:use use-macro="field_macro | context/widgets/field/macros/edit">
<tal:define metal:fill-slot="widget_body" define="contentKeywords accessor;
allowedKeywords python: context.collectKeywords(fieldName, field.accessor, widget.vocab_source);
site_props context/portal_properties/site_properties|nothing;
format widget/format | string:select;
allowRolesToAddKeywords site_props/allowRolesToAddKeywords|nothing;">
<div tal:condition="allowedKeywords" id="existingTagsSection">
<tal:comment tal:replace="nothing">
dl semantically associates selector name with values
</tal:comment>
<dl id="existingTags">
<label for="subject">
<dt id="existingTagsTitle">uuuuuuuuuuuuuuuuuuuuuuuuu
<span i18n:translate="label_select_existing_tags">
Select from existing tags.
</span>
</dt>
<span id="existingTagsHelp" class="formHelp" i18n:translate="label_existingTagsHelp">
Use Control/Command/Shift keys to select multiple tags.
</span>
<tal:comment tal:replace="nothing">
Type-to-skip functionality with javascript enabled
could be described as
"Hover and type the first letter to skip through tags."
However, on touch-driven devices, vertical hover typically
scrolls the page, so horizontal hover is necessary to enable this.
Alternatively, clicking any of the tags also enables type-to-skip.
So the help could technically be extended to handle this special case
as "Hover or click and type the first letter to skip through tags.",
but I think this would be confusing to the majority of users.
The decision at this point is to not try to explain any of this on the page.
</tal:comment>
</label>
<div class="visualClear"><!-- --></div>
<select id="predefined_subjects"
name="predefined_subjects:list"
size="14"
multiple="multiple"
tal:condition="python:format!='checkbox'"
tal:attributes="id string:${fieldName};
name string:${fieldName}_existing_keywords:list;">
<option value="#" tal:repeat="keyword allowedKeywords"
tal:content="keyword" tal:attributes="value keyword;
selected python:test(context.unicodeTestIn(keyword, value), 'selected', None)">
An existing tag
</option>
</select>
<tal:comment tal:replace="nothing">
These spans are hidden by css, and used by the JavaScript called below.
</tal:comment>
<span id="noTagsSelected" i18n:translate="label_noTagsSelected">No tags currently selected.</span>
<span id="oneOrMoreTagsSelected" i18n:translate="label_oneOrMoreTagsSelected">% tags currently selected.</span>
<tal:comment tal:replace="nothing">
Call js to modify this widget with both a scrollbar and checkboxes.
There may be a better place to put this js call;
examples exist in others' widget.py and js files,
but having it here covers cases where some but not all select elements
call js to be modified.
Todo: The #subject should eventually refer to the template variable.
</tal:comment>
<script type="text/javascript">
jq(document).ready( function() {
jq("#subject").multiSelect();
});
</script>
<input type="hidden"
value=""
tal:condition="not:field/required | nothing"
tal:attributes="name string:${fieldName}_existing_keywords:default:list" />
<tal:loop tal:repeat="keyword allowedKeywords"
tal:condition="python:format=='checkbox'">
<div class="ArchetypesKeywordValue" id=""
tal:attributes="id string:archetypes-value-${fieldName}_${repeat/keyword/number}">
<input class="blurrable"
tal:attributes="
type string:checkbox;
name string:${fieldName}_existing_keywords:list;
id string:${fieldName}_${repeat/keyword/number};
checked python:test(context.unicodeTestIn(keyword, value), 'checked', None);
value keyword" />
<label
tal:content="keyword"
tal:attributes="for string:${fieldName}_${repeat/keyword/number}">
An existing tag
</label>
</div>
</tal:loop>
</dl>
<dl id="selectedTagsSection">
<dt id="selectedTagsHeading" class="formHelp"></dt>
<dd id="selectedTags"></dd>
</dl>
<div class="visualClear"><!-- --></div>
</div>
<!-- <tal:condition condition="python:not widget.roleBasedAdd or (allowRolesToAddKeywords and [role for role in user.getRolesInContext(context) if role in allowRolesToAddKeywords])">-->
<dl id="newTagsSection">
<label for="subject_keywords">
<dt id="newTagsTitle">
<span i18n:translate="label_create_new_tags">
Create and apply new tags.
</span>
</dt>
<span id="newTagsHelp" i18n:translate="label_newTagsHelp" class="formHelp">
Enter one tag per line, multiple words allowed.
</span>
</label>
<br />
<dd id="newTags">
<textarea
id="entered_subjects"
name="subject:lines"
rows="4"
tal:attributes="id string:${fieldName}_keywords;
name string:${fieldName}_keywords:lines;"
tal:define="subject python:[item for item in value if not context.unicodeTestIn(item,allowedKeywords)]"
tal:content="python:'\n'.join(subject)">
A new tag
</textarea>
</dd>
</dl>
<!-- </tal:condition>-->
</tal:define>
</metal:use>
</metal:define>
<div metal:define-macro="search">
<div metal:use-macro="context/widgets/keyword/macros/edit">
</div>
</div>
</body>
</html>
I fear is a know issue of the old Plone 4 keyword widget.
You should probably change the widget.
An add-on like eea.tags should help.
You can also try to use Plone 5 widget from plone.app.widgets, but this probably it's a more complex task (and not without side effects).

Linking Images Mystery [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am working on a site that has a lot of images. I've gotten all of the images linked except for one. I have no idea why this one image won't link. If any one has any ideas, that would be a great help. Thanks!
Also, the image I am trying to link is named:timthumb.php.jpeg
And, here is a link to the site: http://emilymagnuson.com/bobsoutdoorgoods/Novelty1.html
Here's a snippet of the code where the image is linked:
<div class="centerbox4" id="centerbox4">
<div class="singleproductimage" id="singleproductimage"><img src="../../../images/_ProductImages/Cycle/Novelty/Large400/timthumb.php.jpeg" width="400" height="400" alt="REI HooDoo Tent" />
</div>
<div class="ProductDescription" id="ProductDescription">
<p><span class="darkparagraph">ULock Belt</span><br />
This ULock Belt is very handy for keeping your ULock in a safe place.</p>
<p><br />
<span class="largeprice">$55.00</span>
<br /><br />
Item # 748114
<br />
<form id="form1" name="form1" method="post" action="">
</p>
<p>
<label for="menudrop"></label>
<div class="dropdown" id="dropdown">
<form action="http://www.mydomain.com/myformhandler.cgi" method="post" name="dropdown" id="dropdown">
<div align="left">
<select name="mydropdown">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
</form>
<br />
<img src="../../../images/addtocart.jpg" onmouseover="../../images/addtocarthover.jpg" onmouseout="../../images/addtocart.jpg" width="150" height="39" alt="Add To Cart" />
</div>
</p>
</div>
</div>
<!--EndCenterBox2-->
</div>
<!--EndCenterBox-->
In general when diagnosing broken links like this, first confirm that the image is where you think it should be. Then confirm that the image itself is readable as an image and not corrupt by copying it to your workstation and trying to view it there. Then try linking to it directly in your browser. It is probably something simple that is wrong. The developer tools that come with Safari, Chrome, or as plug-ins for Firefox (Firebug, for example) can help a lot, too.
It seems the problem is the URL for the broken image is actually not an image. Just go to this URL in a browser:
http://emilymagnuson.com/bobsoutdoorgoods/images/_ProductImages/Cycle/Novelty/timthumb.php.jpeg
PHP spits out the following error:
Parse error: syntax error, unexpected T_STRING in
/home/content/e/m/i/emilymagnuson/html/bobsoutdoorgoods/images/_ProductImages/Cycle/Novelty/timthumb.php.jpeg
on line 57
And timthumb.php seems to be a PHP script.
Looking at the code in the site utself it seems like you have that link hardcoded for some reason:
<!--ProductBox-->
<div class="productbox" id="productbox">
<!--ProductImage-->
<div class="productimage" id="productimage"><img src="images/_ProductImages/Cycle/Novelty/timthumb.php.jpeg" width="200" height="200" alt="ULock Belt" />
</div><!--EndProductImage-->
<!--ProductDescription-->
<div class="Productdescription" id="Productdescription"><span class="lightparagraph">ULock Belt</span><br />
<span class="darkparagraph"> $55.00</span>
<!--EndProductDescription-->
</div>
</div>
<!--EndProductBox-->
Seems like a simple image URL mistake on your part.

What is the proper way to edit items in a listview when using Kendo UI Mobile & MVVM?

What is the proper way to edit items in a listview when using Kendo UI Mobile & MVVM?
I don't get the expected results when using the following:
HTML
<div id="itemsView"
data-role="view"
data-model="vm">
<ul data-role="listview" data-bind="source: items"
data-template="itemsTemplate">
</ul>
<script id="itemsTemplate" type="text/x-kendo-template">
<li>
#=Name#
</li>
</script>
<input type="text" data-bind="value: newValue" />
<button data-role="button" data-bind="click: update">update</button>
</div>​
JavaScript
var vm = kendo.observable({
items: [{
Name: "Item1"}],
newValue: '',
update: function(e) {
var item = this.get("items")[0];
item.set("Name", this.get("newValue"));
//adding the follwoing line makes it work as expected
kendo.bind($('#itemsView'), vm);
}
});
kendoApp = new kendo.mobile.Application(document.body, {
transition: "slide"});​
I expect the listview to reflect the change to the Name property of that item. Instead, a new item is added to the listview. Examining the array reveals that there is no additional item, and that the change was made. (re)Binding the view to the view-model updates the list to reflect the change. Re-Binding after a change like this doesn't seem to make any sense.
Here is the jsfiddle:
http://jsfiddle.net/5aCYp/2/
Not sure if I understand your question properly: but this is how I did something similar with Kendo Web UI, I expect mobile is not so different from Web UI from API perspective.
$element.kendoListView({
dataSource: list,
template: idt,
editTemplate: iet,
autoBind: true
});
The way I bind the listview is different, but I guess you can get similar results with your method as well.
I pass two templates to the list view, one for displaying and one for editing.
Display template contains a button (or any element) with css class k-edit to which kendo will automatically bind the listview edit action.
display template:
<div class="item">
# if (city) { #
#: city #<br />
# } #
# if (postCode) { #
#: postCode #<br />
# } #
<div class="btn">
<span class="k-icon k-edit"></span>Edit
<span class="k-icon k-delete"></span>Delete
</div>
</div>
Edit template
<div class="item editable">
<div>City</div>
<div>
<input type="text" data-bind="value: city" name="city" required="required" validationmessage="*" />
<span data-for="city" class="k-invalid-msg"></span>
</div>
<div>Post Code</div>
<div>
<input type="text" data-bind="value: postCode" name="postCode" required="required" validationmessage="*" />
<span data-for="postCode" class="k-invalid-msg"></span>
</div>
<div class="btn">
<span class="k-icon k-update"></span>Save
<span class="k-icon k-cancel"></span>Cancel
</div>
</div>
Clicking that element will put the current element on edit mode using the editTemplate.
Then on the editTemplate there is another button with k-update class, again to which kendo will automatically bind and call the save method on the data source.
Hopefully this will give you more ideas on how to solve your issue.
The problem was caused by the <li> in the template. The widget already supplies the <li> so the additional <li> messes up the rendering. This question was answered by Petyo in the kendo ui forums

how to pull href link

I am trying to pull a link from a page that is in a formal I can't seem to find by simply googling... it might be simple but xpath is not my area of expertise
I am using c# and trying to pull the link and just write it to the console to figure out how to get the link
here is my C# code
var document = webGet.Load("http://classifieds.castanet.net/cat/vehicles/cars/0_-_4_years_old/");
var browser = document.DocumentNode.SelectSingleNode("//a[starts-with(#href,'/details/')]");
if (browser != null)
{
string htmlbody = browser.OuterHtml;
Console.WriteLine(htmlbody);
}
the html code section is
<div class="last">…</div>13»
<select name="sortby" class="sortby" onchange="doSort(this);">
<option value="">Most Recent</option>
<option value="of" >Oldest First</option>
<option value="mw" >Most Views</option>
<option value="lw" >Fewest Views</option>
<option value="lp" >Lowest Price</option>
<option value="hp" >Highest Price</option>
</select><div style="clear:both"></div>
</div>
<br /><br /><br />
<a href="/details/2008_vw_gti/1454282/" class="prod_container" >
<h2>2008 VW GTi</h2>
<div style="float:left; width:122px; z-index:1000">
<div class="thumb"><img src="http://c.castanet.net/img/28/thumbs/1454282-1-1.jpg" border="0"/></div>
<div class="clear"></div>
mls
</div>
<div class="descr">
The most fun car I have owned. Dolphin Grey, 4 door, Dual Climate control, DRG Transmission with paddle shift. Leather...
</div>
<div class="pdate">
<p class="price">$19,000.00</p>
<p class="date">Kelowna<br />Posted: Oct 15, 2:54 PM<br />Views: 349</p>
</div>
<div style="clear:both" ></div>
<div class="seal"><img src="/images/bookmark.png" /></div>
</a>
<a href="/details/price_drop_gorgeous_rare_white_2009_honda_accord_ex-l_coupe/1447341/" class="prod_container" >
<h2>PRICE DROP!!! Gorgeous Rare White 2009 Honda Accord EX-L Coupe </h2>
<div style="float:left; width:122px; z-index:1000">
<div class="thumb"><img src="http://c.castanet.net/img/28/thumbs/1447341-1-1.jpg" border="0"/></div>
<div class="clear"></div>
sun2010
</div>
<div class="descr">
the link I'm trying to get is the "/details/2008_vw_gti/1454282/" part. THanks
HTML isn't XML.
XPath is a tool for navigating through XML documents, however HTML does not conform to XML requirements. The HTML you've linked about isn't well formed XML, and as such XPath won't work.
You either need to look at using an HTML to XML convertor, and then adding the output of that conversion to your question to write XPath against, or investigate using a different tool for the job. I'd suggest doing a Google search for "C# HTML scrapers", but I'm not familiar with .Net so I can't offer a narrower option.
Try the following Xpath expression :
//a[#class="prod_container"]/#href

Resources