Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi this is my code, in ascx file. There is problem in it. It seems that it dosen't understand Javascript!
 
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CriteriaControl.ascx.cs" Inherits="Controls_CriteriaControl" %>
<link href="../Stylesheet/table.css" rel="stylesheet" type="text/css" />
<link href="../Stylesheet/Button.css" rel="stylesheet" type="text/css" />
<link href="../Stylesheet/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css" />
 
<script type="text/javascript" src="../JavaScript/jquery-1.7.2.js"></script>
<script type="text/javascript" src="../JavaScript/jquery-ui-1.8.21.custom.min.js"></script>
 
<script language="javascript" type="text/javascript">
    $(function () {
        $("#help-icon").button
            ({
                icons:
                {
                    primary: "ui-icon-help"
                },
                text: false
            });
 
        $("#help-icon").click
        {
            $(function () {
                var moveLeft = 20;
                var moveDown = 10;
 
                $('#help-icon').hover(function (e) {
                    $('div#pop-up').show();
                },
                        function () {
                            $('div#pop-up').hide();
                        });
 
                $('.help-icon').mousemove(function (e) {
                    $("div#pop-up").css('top', e.pageY + moveDown).css('left', e.pageX + moveLeft);
                });
            });
        }
    });
 
    $(function () {
        $("#slider-range").slider({
            range: true,
            min: 0,
            max: 100,
            values: [0, 100],
            slide: function (event, ui) {
                $("#amount1").val(ui.values[0]);
                $("#amount2").val(ui.values[1]);
            }
        });
        $("#amount1").val($("#slider-range").slider("values", 0));
        $("#amount2").val($("#slider-range").slider("values", 1));
    });
</script>
 

<div class="divTable">
    <div class="divRow">
 
        <div class="divCell">
            <input type="text" id="lable" value="something" readonly="readonly"/>
            <button id="help-icon" style="width:13px ; height:13px">help</button>
            <div id="pop-up" class="divCell">
                loading...Say what u want!
            </div>
        </div>
 
        <div class="divCellmine">
            <label for="amount1">min:</label>
            <input type="text" id="amount1" style="border:0; font-weight:bold;" />
        </div>
           <div class="divCellmine">
        <div id="slider-range" style="width: 142px; height: 1px"></div>
           </div>
        <div class="divCellmine">
            <label for="amount2">max:</label>
            <input type="text" id="amount2" style="border:0; font-weight:bold;" />
        </div>
 
    </div>
</div>
 

 

this code has a lable, a button , a slider that by changing its handler two lables are changed...
 
I'd be glad to help me...
Thanks
Bahar
Posted 3-Jul-12 5:12am
Comments
priyanka Dhoble at 3-Jul-12 10:22am
   
Can you explain the problem in more detail? Is it throwing some error? Is the control dynamically loaded on page?
Sandeep Mewara at 3-Jul-12 10:28am
   
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.
Shemeer NS at 3-Jul-12 10:29am
   
What problem exactly you are facing? What's going wrong this code?
bahar_Agi at 3-Jul-12 23:44pm
   
In fact I want to write a dynamic user control with JQuery to be client side. but it has problem in ascx. I know it is obvious that it doesn't work in a server side page.But the problem is: I don't know how to write a client side dynamic user control...

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Remove the jQuery script tags and the jQuery functions and place them into the Page instead of the user control. It will work..
  Permalink  
Comments
aspnet_regiis at 3-Jul-12 10:54am
   
In that case you need to specify the path to the jQuery library from the root of the website folder
 
For e.g.
 
<script type="text/javascript" src="~/MyScripts/JavaScript/jquery-1.7.2.js"></script>
<script type="text/javascript" src="~/MyScripts/JavaScript/jquery-ui-1.8.21.custom.min.js"></script>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 485
1 Maciej Los 288
2 OriginalGriff 229
3 Zoltán Zörgő 200
4 BillWoodruff 170
0 OriginalGriff 7,934
1 DamithSL 6,084
2 Sergey Alexandrovich Kryukov 5,449
3 Maciej Los 5,174
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 3 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100