I have a view on which two partial views are rendered.One partial view(lstContactPerson) contains the List of contacts(image and other details) and action buttons for View/Edit/Delete.On Edit button-click details of a record is rendered in another partial view(Contact) for edit. After submitting Contact form the details are updated but not an image on lstContactPerson view without reloading the page.
I have searched for this and found that issue must be of caching and i implemented most of cache removing/Disabling stuff but issue is not resolved.
try adding some random value to image url. it will ensure that image is not fetched from browsers cache
http://yourimage.png?nocache={GUID}
Related
Inherited a Sitefinity website. There's a news list page, which I discovered is reused by the news detail pages to display content. If I update the list page, the changes are reflected on the detail pages.
Sometimes.
I have a content block that contains a "header" text - updating this in the list page is replicated across the details pages. Adding a javascript widget to the page to inject some custom javascript replicates across the details pages as well.
Adding a new content block or css widget does not replicate across the details pages.
Is there some rhyme or reason to this behavior that I'm missing?
My specifics:
I've successfully created widgets in the MVC several times now. I essentially need to add a new widget to just the news pages. Which seemed simple enough until I discovered that news pages are not individually created pages like... well, pages... but instead are just a content piece that is dynamically inserted in the news widget on the "parent" listing page. At least as far as I can tell that's how it appears to be working.
Adding my widget to the page didn't work, as I explained above. I then tried recreating it in the page itself using javascript, content block, and css widgets, at which time I discovered that the javascript is the only one making it to the details pages. I imagine this has to do with the way javascript widgets actually make it to the page - their placement is selected in advanced options, rather than simply appearing inline.
Sitefinity widgets go beyond presentation, and actually control routing.
As such content widgets (baseline or custom) have two 'modes' that they operate in: list and detail. Slugs for details are automatically generated in the following format.
/News
/News/{News-item-slug}
Of course, a list and a detail should look very different. To accommodate that, the widgets have two separate configurable templates.
So, add your custom html and javascript to the appropriate template to have it only apply in a given mode.
In my project, there are five navigation links, represented using #html.ActionLinks as Partial view.Every link represents a different page. When the user is at first page all the links should be disabled
when the user is directed to second page on clicking a button, only first link becomes active and other all links remain inactive.
In every view I am calling this partial view by #html.RenderPartial("_partialViewName")
So how can I change the behavior of ActionLinks dynamically in a controller?
I'm converting my site from using jQueryUI to jQuery Mobile, and I'm having some trouble.
I have a page that lets users add new timesheet entries. They click the "Add" button and it retrieves a Partial View from the server right onto the page.
The problem is that jQuery Mobile is not applying to any of the elements in the Partial View.
How can I force jQuery Mobile to process my elements after they've been inserted into the page?
The short answer is that you can just trigger the create method on the parent element of where you inserting your partial view.
For example $('#container').trigger( "create" );
Alternatively most widgets can be manually initialized by calling them on the element, for example for a listview: $('#myListview').listview(). This can be useful if you have only a few elements that need to be enhaced and you don't want to traverse all the child elements of the container. You should also know that for many widgets there is also a refresh method which you can call if you add elements to it after it has already been initialized for example $('#myListview').listview('refresh).
Also have a look at the following Q & A from the JQM docs which deals with this issue and for an explanation as to why it is necessary to call these methods.
Question: Content injected into a page is not enhanced.
Answer:
jQuery Mobile has no way to know when you have injected content into a
page. To let jQuery Mobile know you have injected content that must be
enhanced, you need to either make sure the plugins are called to
enhance the new elements or trigger("create") on the parent container
so you don't have to call each plugin manually.
I want to enable caching for a page that loads when an ListView item is clicked. So when the user clicks a second time on the same item, the app will navigate to the previous cached page.
(I'm using LayoutAwarePages and I suspect that this should be possible if in the OnNavigatedTo method the NavigationMode parameter is different from NavigationMode.New)
Any ideas?
You affect the page caching by setting the NavigationCacheMode property of the page in its constructor. By default it is disabled, but if you enable it, you'll get the existing page instance every time you navigate to it. This means that even if the user navigates to a different item in your ListView, the same instance of the page will be reused.
I've found a library reimplementing the navigation framework to make it more like the one in Windows Phone, i.e.:
When navigating back the cached page is used.
When navigating forward a new instance of the page is created.
If I understand your question correctly, you require a different caching behavior from both of the above. To achieve that you could either base your alternative navigation framework on the one in the library I linked to or simulate the behavior by persisting just the page state for each item instead of actually caching the pages.
I am new to Jquery mobile and asp.net mvc4. In my application I have divided my page into three blocks(ui-block-a,ui-block-b,ui-block-c).These three blocks are in shared folder(_Layout.cshtml). Left side and right side blocks are partially viewed. In the middle block is normally viewed. When I perform any modification the partial view is also refershing.I want to load my partial view on my first time loading only. If I do any change on middle block the partial views should not be affected. please help how can
I do this?
Partial view doesn't mean it would be partially updated. It's just a small chunk of ui code wich is suitable to be grouped into a separated file for reuse.
you'll need to implement ajax functions into middle block when updating.
jQuery.ajax
would be the api you can refer to.