Category Archives: Jquery

[RESOLVED] How to get keyevents on Page_Load

Hi guys,,

I am developing a website using ASP.NET 2.0 with C#.

Now i need to disable the Variuos key combinations such as CTRL_ALTR_DEL, .......after pressing any key on the web page irrespective to the page controls. I need this code snippets in the C# of a ASP.NET Webpage....

DISABLE CTRL_ALT_DEL???? Good luck and have fun.


OMG.

Morzel

You can try the below code of jQuery for getting ur requirements to fit :-

 

$('#txtName').bind('keydown', function(e) {
     if(e.which == 17 && e.ctrlKey && e.altKey) {         //write code to prevent default action     }

});

 

(KeyCodes for AltKey= 18, ControlKey = 17 & DeleteKey=46)
Think may help to get the right way to get the solutions.... 

[RESOLVED] Fancyzoom on image do works, but not if Page_Load event runs the second time

Hi,

I am using the fancyzoom to make a picture bigger when clicking on it. The example and downloaded files is here: http://www.dfc-e.com/metiers/multimedia/opensource/jquery-fancyzoom/

Now when the first Page_Load is running, I am putting Pic1.jpg to the control and the fancyzoom works fine.

Now when the Page_Load will run the second time, Pic2.jpg is set to the control as seen in the code I have below. This do works fine but the fanzyzoom does not work now.

 

It seems that the fancyzoom functionality dissapeared when the Page_Load event did run the second time although the Pic2.jpg was successfully set to the imagecontrol.

So I wonder why this is happening and what I would need to do?

Thank you

(C#)
    public String myGallery1 = "";


    protected void Page_Load(object sender, EventArgs e)
    {
		myGallery1 = "~/Gallery/Pic1.jpg";
		

		if( Session["SecondPageLoad"] != null )
		{
			myGallery1 = "~/Gallery/Pic2.jpg";
		}
		Session["SecondPageLoad"] = "dummy";
		Page.DataBind();
    }


(HTML)
<asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<script type="text/javascript" src="<%= ResolveUrl("~/jscripts/fancyzoom/jquery.js")%>"></script>
<script type="text/javascript" src="<%= ResolveUrl("~/jscripts/fancyzoom/jquery.js")%>"></script>
<script type="text/javascript" src="<%= ResolveUrl("~/jscripts/fancyzoom/ifixpng.js")%>"></script>
<script type="text/javascript" src="<%= ResolveUrl("~/jscripts/fancyzoom/jquery.fancyzoom.js")%>"></script>


<script type="text/javascript">




    $(function() {
        $.fn.fancyzoom.defaultsOptions.imgDir = "../jscripts/fancyzoom/ressources/";
        $('#gallery a').fancyzoom();
        $('a.tozoom').fancyzoom({ Speed: 1000 });
        $('a').fancyzoom({ overlay: 0.8 });
        $("img.fancyzoom").fancyzoom();
    });
</script>






<a href="<%# myGallery1 %>" style="height:64px"><img runat="server" id="iimage1" src="<%# myGallery1 %>" alt=""
                style="height:64px" /></a>




</ContentTemplate>
</asp:UpdatePanel>


 

Hi,

The javascript seems works fine. I notice that the javascript code was write in updatepanel. Try to move these code out of it and put them into <body> or <head> markup to see if it make sense.

Like:

<body>


<script type="text/javascript" src="<%= ResolveUrl("~/jscripts/fancyzoom/jquery.js")%>"></script>
<script type="text/javascript" src="<%= ResolveUrl("~/jscripts/fancyzoom/jquery.js")%>"></script>
<script type="text/javascript" src="<%= ResolveUrl("~/jscripts/fancyzoom/ifixpng.js")%>"></script>
<script type="text/javascript" src="<%= ResolveUrl("~/jscripts/fancyzoom/jquery.fancyzoom.js")%>"></script>
  

<script type="text/javascript">




    $(function () {
        $.fn.fancyzoom.defaultsOptions.imgDir = "../jscripts/fancyzoom/ressources/";
        $('#gallery a').fancyzoom();
        $('a.tozoom').fancyzoom({ Speed: 1000 });
        $('a').fancyzoom({ overlay: 0.8 });
        $("img.fancyzoom").fancyzoom();
    });
</script>




    <form id="form1" runat="server">
    ...
    ...
    ...
    </form>
</body>


 

Hope this can help you.

Thank you for answer,

That did not work. I tried it too before.

 

However, I did solve this problem in another thread:

http://forums.asp.net/t/1652679.aspx 

[RESOLVED] Drag-and drop and dynamically create web controls

Hi there,

I'm trying to develop a web application where there webpage would contain a list of Web control (textbox, label, calendar...) images on the left (as a menu), and the user would be able to drag any of the images onto a specific space within the page and it would dynamically create that specific control (for example, if the user drags an image of a TextBox into a panel, then a TexBox control would be dynamically created into that panel). 

Basically, I need to reproduce the basic drag-and-drop functionality of an IDE.

To be honest, I have no idea how to do this.. anyone can point me in the right direction??


Thanks!




Hi,

if you want drag & drop you can either go for a javascript based solution like http://jqueryui.com/demos/droppable/#default or you can make use of Silverlight.

Grz, Kris.

[RESOLVED] How can you get the width of the browzer window with Internet Explorer 9.

 How can you get the width of the browzer window with Internet Explorer 9.  Old methods don't appear to work!

check this document.documentElement.clientWidth

Hi,

You can use javascript or jquery api to implement it.

Check these links:

http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/

http://api.jquery.com/width/

Hope this can help you.

[RESOLVED] open a usercontrol(.ascx) in a popup

Hi Friends,

I am trying to put a usercontrol in a popup.. please help me in finding code using any way (ajax, javascript, jquery). i am unable to provide the control in popup.


Thanks

Rama