I have two updatePanels
UpdatePanel1 contains a button
UpdatePanel2 is inside a Multiview View1:
.
<Multiview>
<View1>
<UpdatePanel2>
</UpdatePanel2>
</View1>
</Multiview>
Multiview ActiveIndex is set to -1.
Now I have attached an AsyncPostBackTrigger on UpdatePanel2 which is associated with the button click.
I want to show View1 when I click the button in UpdatePanel1.
You're going to need to put the update panel around the MultiView, rather than inside View1:
<UpdatePanel2><MultiView><View1></View1></MultiView></UpdatePanel2>
An UpdatePanel will render on the page as either a div or a span (a div by default).
When you do a callback (such as when you click the button inside the UpdatePanel), ASP.NET sends a message to the browser telling it how to update the contents of the divs that represent your UpdatePanels. This message is received and handled in javascript.
If you're not showing View1 when you first arrive at the page, then UpdatePanel2 won't get rendered at all. Therefore, when your button click causes the callback, there's no div on the rendered page for javascript to change the contents of.
Related
i have a panel in a page, and in the panel header i have a red delete btn, the panel content contains a form which has a few btns (the red delete btn is not in the form, but its linked to the form via the form="abc" attribute).
in the pic below, When i click the btns in the form, it'll post some values. Before i submit a form (the pink remind button), my red delete button looks like this ( nice and rounded)
enter image description here
but after submit, it became out of shape. ( btn height changed). This only happens after i submit and didnt reload the page, if i reload the page or redirect the page back to itself, then the delete btn will return to its normal shape.
enter image description here
i did not alter the classes of the btns using js or jq, the only thing that happens after i submit are some php scripts which shouldnt affect aesthetics. Also, the panel is reloaded every 5 seconds within the page to update its content, but the whole page itself is not reloaded, so if its html or bs4 issue, then after i submit form, the delete btn should return to normal shape after 5 sec, but it seems like something outside of the panels but within the page needs to be reloaded to change the delete btn back to normal shape. I checked the deletebtn and the parent elements in inspect before submit, after submit, and after reload page, but everything is the same, except that it shows the height px are different.
Can you post snippet of your code?
Alternatively just give inline style attribute to the button and specify height, width, padding etc.
I Have made a form which contains only a tabbed Canvas with three tabs each tab has one data block, I Have also one button which is the Exit button that belongs to one tab (It's not optional from what I see, I have to make the button belongs to one of the three tabs or more specifically to one of the three data blocks).
My problem is that the button will not be displayed when I run the form Unless I Do something with the tab that it belongs to.
But I want it to be displayed unconditionally.
Is there any way to make the button belongs to the Empty Content Canvas
instead of the tab canvas??
I Figured it out, Indeed the button should belongs to a data block, so I made an empty new block inside the Content Canvas and made the button belongs to it.
I have text that I need to link to where you click on it and an iframe window pops up with the content from an external site. I have found code that when I use it, a box appears above the text and the content shows in the box when clicked. But I need it to not show anything until the link is clicked.
<iframe name="book" src="https://www.timetrade.com/book/9PK2K"></iframe>
Book Now!
This is the code I used to try to get it to link to a pop up iframe window but it showed a box above the text.
You'll need to use some javascript for this.
A simple onClick() method that sets the display to 'Block' and 'None' to display and hide, respectively, should do the trick.
The javascript would set style.display="none" by default, and the onClick will be written to set style.display="block" or some un-hidden attribute.
Check out this http://www.w3schools.com/jsref/event_onclick.asp for onClick
and http://www.w3schools.com/jsref/prop_style_display.asp for using javascript to show/hide DOM objects.
Good luck!
I have the following HTML code:
<div onclick="window.open('http://example.com')" >
<p>1234 Main St, New York, NY</p>
<p>Price: $200,000/p>
<p>4 Beds / 3 Baths</p>
<p>2000 sqft</p>
More Info
</div>
If the person hovers over the part of the DIV that is not the hyperlink, it only opens one window.
If the person clicks on the hyperlink within the DIV, it opens 2 windows (one for the DIV and one for the hyperlink).
Is there any way around this 2x opening window scenario?
The simple solution:
More Info
You could make the div clickable by making the link into a block element with css
div a {
display: block;
}
That's because the click event bubbles up. It initiates when you click the anchor element, than bubbles up to the div, and executes that too.
You need to capture the click event inside the div (using a function), and then call the event's stopPropagation method to stop it from bubbling up.
More info about event bubbling here: http://www.quirksmode.org/js/events_order.html
You could use the same function in both the DIV and the A HREF, and manage the opening inside that function to call the window only once, that will work.
Edit : If you care at least a little about Search Engine Optimization you should not use that caption for the link, but more something mentionning the content of the next page like "House details" or better depending of the context/look of the page.
I came across the same issue and please don`t laugh on my silly mistake. But two tabs was opening because i am having a link and having target='_blank' and also calling a function too on the same like:
<pre>
$('#foo').on('click',function(){
// some code
window.open("https://www.google.com","_blank");
});
where also i have added the target as _blank. i removed the target attribute from the anchor and it works fine for me. Hope you are not doing same.
I have created a custom TitleWindow whcih i use as a popup. The contents of the popup are created dynamically depending on a selection a user makes from a datagrid.
My problem is, my datagrid is in another custom component whcih is toward the bottom of my page so when a user clicks one of the items the popup is displayed however with half of it out of sight at the bottom of the page.
Is there a way to position a popup so that it displays at the top of the page?
I know at least two things you can use to position a popup, though there might be more.
When you place a popup you can choose in which parent component to place the popup:
PopUpManager.createPopUp(this.parent, TitleWindowComponent);
In the component itself:
PopUpManager.centerPopUp(this);
I wanted a help tooltip type popup (with help text) to appear next to the icon that opened it. In the end I used move(x,y) to move the window where I wanted it. To get the coordinates to place it, use globalToLocal:
var globalX:Number = localToGlobal(new Point(myIcon.x, myIcon.y)).x;
var globalY:Number = localToGlobal(new Point(myIcon.x, myIcon.y)).y;
toolTip.move(globalX + myIcon.width, globalY);
That puts the window just to the right of the icon, myIcon.