I am trying to create on the fly when i click a button in my ASPX page. I need to apply dragable property to the dynamically generated images. How can I go about it.? Jquery or AJAX.? How to apply the dragable property to every dynamically created images.
Use jqueryUI to make the images dragable. It is very simple.
$('img').draggable().click(function(){
alert('click event');
});
<div id="draggable" class="ui-widget-content">
<p>Drag me around</p>
</div>
Go to this site for more information. http://jqueryui.com/draggable/
See the following jsfiddle for example. http://jsfiddle.net/Doinkmeister/Rtwcj/
Just make all the images draggable.
$('img').draggable();
You can check this posts-
http://delicious.com/anupdg/draggable+database
Regards
Anup
Related
I have some code clarification. I have a project that in MVC. When view loaded in the web application and then need to be create input button dynamically in the view page. And also how they merge in the controller. I don't have any idea about this I checked many webs but does not have any answer for this.
How to create button dynamically when view load in the web?
If you want to create button after the page loads then you have to use javascript to create the html and then add that to the page.
For example:
$(document).append(
$("input")
.attr("type", "button")
.click(function(){
doSomething()
))
);
You can find the detail of the answer here: Inject html using Javascript
Im using .net c# MVC3 Model. I need to show a gif called loading when I click save on the page. I used <img src="sourcepath" alt="loading" style="display:none"/> and trying to display it whenever user clicks save button using jquery. I have stored the image temporarily in views folder. Unfortunately, i could not see image on the screen. I can see its division with a small red cross cancel button.
Pls Help
If you're seeing the broken image icon, it means your src "sourcepath" is wrong. You would normally put static content in the Content folder of your site, and access it using /Content/imagename.jpg or /Content/Images/imagename.jpg or similar.
Try to use the search, here you can find an solution the show an spinner when doing ajax requests:
How to show loading spinner in jQuery?
I have a content page(Say.. invoice.aspx) in asp.net application with master pages.
The content page(invoice.aspx) is using a gridview, which displays records from database.
Currently i am navigating to this page using - Response.redirect("invoice.aspx") and this is working fine.
But i need to display this page as pop-up from calling page, so that this popup invoice can be seen on the top of other pages.
Please help me if this can be done using javascript or some other way.
Thanks in advance..
A page popup can be implemented using a div as a container with a different style (opacity, window position, size etc) and has a higher z-index than the rest of the page.
thus basically you need a structure like
<div class="overlayOuter">
<div class="overlayInner">
<!-- external content to be loaded here -->
</div>
</div>
and now using AJAX you load the invoice.aspx page to the inner container and show the container and reduce the opacity of the outer container.
There should be libraries out there that let you do this. you need to explore that on your own.
You can use modal popups for the above scenario:
one example can be found here: http://sandbox.scriptiny.com/tinybox2/
its easy and not much code you need to write and also can load popup as an iframe so postbacks can be handled without posting back parent page or you can use ajax
function OpenWindow(strChildPageUrl) {
var testwindow = window.open(strChildPageUrl, "Child", "width=700px,height=650px,top=0,left=0,scrollbars=1");
testwindow.moveTo(100, 0);
}
</script>
Any ideas how to remove/hide/disable and make invisible the sidebar (with all of the links in it) from a Wizard Control?
Cheers.
You can achieve this using the Wizard.DisplaySideBar Property like so:
<asp:Wizard ID="wizard1" runat="server" DisplaySideBar="false">...
You can find it in:
Wizard properties.
highlight the .aspx form code then look for it in behavior.
click Image where to find it
I have an asp.net page, with couple of Divs, some of these div's get the image path from database and show the image in a smaller version (thumbnail). and as soon as user click on thumbnail, I use ajax Modal popup to show the full size image, what I need to have is to have a progree image(gif), on every thumbnail image while loading the asp.net page for the first time, I konw that it is possible to use UpadePanel, but I need the actual working code,or any other way to achieve this,
Thanks in advance
Well, if you are posting back, udpate panel can work; but you can programmably in JS do this yourself, or also consider using a JS plugin like lightbox: http://www.huddletogether.com/projects/lightbox2/
Which has that feature and looks very cool.