I have an Iframe that initialy doesn't apply the CSS (checked the view source and the CSS link is available) but when I click on a button (submit) it reloads the same page with correct CSS and I can see the styles.
Any intial thoughts on why it is behaving like this?
Language: ASPX.Net
Are you calling it in an iframe? Sometimes iframes (if on the same domain) can apply the styles within. Depends on how it's called. Also perhaps your headers are not set properly before you do a form submit. Do you have a URL we can see?
Related
How can i get the updated iframe src value after my user navigates throught the site that is inside the iframe?
I'm asking this because the src value is always the same! It don't change even if you navigate inside the iframe.
Thanks
easiest way is to use javascript to dynamicly refresh the <iframe> by setting the src to a given interval refresh rate.
Have a look at the below example
dynamicly refresh iframe without refreshing current page
When an htmlActionLink is clicked, a new page (say About) is opened with layout and the main body is rendered from the corresponding view. I want to change the style of the about link to show that this link is active. I tried a lot using jquery. It changes momentarily, but it comes back to its original style. I have not tried it through controller. I've used jquery in the layout.cshtml and about.cshtml page.
Look in to MvcSiteMap. You can use the MVC helpers to create a navigation menu that changes as you visit pages. Also, keeping it server side over using jQuery is going to be the best bet.
I have an iframe within div
<div>
<iframe pageB>
</div>
on button click in iframe, redirected to a different page A - I have a jquery to hide the div on page load of A - so this part of jquery is not working - normal alert window on this page load works - I saw $ undefined - included jquery exclusively on pageA but still undefined error has gone but jquery does not work - can any body shed some light on this? doesnt jquery work in this redirection scenario.
If the IFRAME is on a different domain than the DIV this will not work due to security restrictions.
Instead of an IFRAME you could try using jQuery.load() to put the content into your div, and then hide the DIV as a part of the callback to load(). This will only require jQuery to be loaded on your main page.
I used a iframe tag to show anther website. But I want people click wherever in the iframe, they can be redirect to another website as I shown in the iframe.
I tried to use onclick event, However, I found that it will not be support because of the security issue. Does anyone know how to do it instead of using onclick.
I don't know it is a good trick or not but you can have a try with this technique
As a iframe source, set a page which is in your server and on that page create a "DIV" and under the "DIV" create one new iframe with another website url. Now set an onClick event on that "DIV" which is basically on your server page. Set an "opacity" through CSS class on that div.
<iframe src="file-in-your-server.html" ></iframe>
file-in-your-server.html
<div style=""><iframe src="http://www.google.com"></iframe></div>
Hope it works, I have not tried it yet.
I am building an admin portal for a helpdesk. On one page I have a dropdown with a LinkButton, and another a dropdown with a Button. Both buttons redirect to the page they are clicked from by firing off a Response.Redirect(), like so:
Response.Redirect(String.Format("article.aspx?action={0}", ActionDropDown.SelectedValue), False)
This allows me to use one page for multiple functions.
Anyway, the page that the LinkButton does NOT work on has a WYSIWYG editor, FCKeditor, in it and FireBug throws the following error when I click the LinkButton:
FCKeditorAPI is not defined
- WebForm_OnSubmit()()
- WebForm_OnSubmit()
- __doPostBack("ctl00$Content$LinkButton1", "")
- Sys$WebForms$PageRequestManager$_doPostBack("ctl00$Content$LinkButton1", "")
- (?)()()
- javascript:__doPostBack('ctl00$Content$LinkButton1','')
- var editor = FCKeditorAPI.GetInstance('ctl00_Content_NewArticleEditor');
No errors when I use a button. Any thoughts?
Javascript is NOT disabled in the client.
Not a full answer here, but a couple of things to check would be that you ensure JavaScript turned on on the client? (sounds like it from the error).
The most obvious thing to check would be what the button is actually doing on the click. Is it rendered as a submit button, or is it doing a postback?
LinkButton uses javascript. Check that it's not turned off on the browser.
I think that it's because LinkButton is rendered into his own <form>, which is inherited in the FCKEdit, or maybe FCKeditor overrides it's form's onSubmit behaviour?
Generally, when a browser encounters a JavaScript error, all script after that point fails to work.
Is the FCK editor working as you expect it to? Are all the JavaScript files that it requires in place correctly? You can check this on the Scirpt tab of FireBug:
Select the Script tab, ensure that script is enabled, and then in the top row of FireBug, you should see something like:
Clicking on the page path allows you to inspect the other JS includes:
Check that each of the requested files isn't returning an error of some kind.
Finally, are you using the FCKEditor.Net wrapper to access the FCK Editor, or just the editor as it stands?