Click here to Skip to main content
15,886,919 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: filter query with pagesize Pin
miss78610-Feb-14 0:37
miss78610-Feb-14 0:37 
QuestionTelerik grid vs. Kendo grid and Ajax calls Pin
littleGreenDude5-Feb-14 8:36
littleGreenDude5-Feb-14 8:36 
AnswerRe: Telerik grid vs. Kendo grid and Ajax calls Pin
littleGreenDude7-Feb-14 3:10
littleGreenDude7-Feb-14 3:10 
QuestionRDLC Report Designing Pin
Dnyaneshwar@Pune5-Feb-14 0:48
Dnyaneshwar@Pune5-Feb-14 0:48 
SuggestionRe: RDLC Report Designing Pin
Zohaib Asad11-Feb-14 21:13
Zohaib Asad11-Feb-14 21:13 
QuestionQuestion Event does not run when I click image that has event attached to it Pin
versm1ca4-Feb-14 22:21
versm1ca4-Feb-14 22:21 
AnswerRe: Question Event does not run when I click image that has event attached to it Pin
Deflinek5-Feb-14 0:48
Deflinek5-Feb-14 0:48 
GeneralRe: Question Event does not run when I click image that has event attached to it Pin
versm1ca5-Feb-14 7:19
versm1ca5-Feb-14 7:19 
I am so excited it is starting to work .. I moved the script to a separate script tag as shown (just as you have advised) and it started showing up the "hello" message every time I open up a page attached to the master file .. yeeeey ... Smile | :)

$('.main').ready -------------- this event is working perfect

The way the code was written when the beautiful thing event I report happens is shown below:
XML
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="SiteMaster" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript" >



    </script>
    <script  type="text/javascript" >

        $('.main').ready(
             function () {
                 alert('hello');
             });

        $('img').click(
             function () {
                 alert('hello from image');

             });

    </script>
    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
    </asp:ContentPlaceHolder>
</head>

The one I find odd however is that the click event is still not getting triggered
for some reason .. so what I did next was try to change it to a different tag targeting paragraph tag instead of img but retain it in the same spot i.e.
$('p').click(


The result is that it still is not triggered when I click from a paragraph the way it was not working when I was clicking from an image using the original code which used the img tag.

So I decided to try changing the event to a mouseover instead of a click as shown below:
$('p').mouseover(


Unfortunately the event is still not get triggered when I move my mouse over the paragraph elements ..

So at this point I am thinking it does not seem to have
anything to do with the tag selector or the event type ..
I decided to experiment and move the code as close to the
page being called (I'd wish of course that it could be
centralized in just one page i.e. Site.master) but just
for the sake of experiment I tried putting the code in the
page itself that is being called as shown below:

XML
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        <script  type="text/javascript" >

            $('p').click(
             function () {
                 alert('hello from click of paragraph');

             });

       </script>
    <h2>
        Testing this page.
        <asp:TreeView ID="TreeView1" runat="server">
        </asp:TreeView>
    </h2>
    <p> testing paragraph1
    </p>

    <p>
        testing paragraph2
    </p>

     <img src = "Image/coreTechnologies.png">


</asp:Content>


Unfortunately I still cannot get the click event to run
.. and right now I am scratching my head and trying to dig
in the books what I am still missing ... all help much appreciated ..thanks again and more power
GeneralRe: Question Event does not run when I click image that has event attached to it Pin
Richard Deeming5-Feb-14 8:15
mveRichard Deeming5-Feb-14 8:15 
GeneralCLOSED --- Re: Question Event does not run when I click image that has event attached to it Pin
versm1ca5-Feb-14 14:00
versm1ca5-Feb-14 14:00 
Questionradiobuttonlist change event with javascript Pin
ptvce4-Feb-14 1:21
ptvce4-Feb-14 1:21 
QuestionFlash Banner in Mobile asp.net Pin
Fcode-20143-Feb-14 21:28
Fcode-20143-Feb-14 21:28 
QuestionIf else structure problem Pin
Hunain Hafeez3-Feb-14 18:44
Hunain Hafeez3-Feb-14 18:44 
AnswerRe: If else structure problem Pin
Kornfeld Eliyahu Peter3-Feb-14 20:17
professionalKornfeld Eliyahu Peter3-Feb-14 20:17 
QuestionRetry on duplicate keys ex Pin
byka3-Feb-14 6:50
byka3-Feb-14 6:50 
AnswerRe: Retry on duplicate keys ex Pin
Kornfeld Eliyahu Peter3-Feb-14 9:52
professionalKornfeld Eliyahu Peter3-Feb-14 9:52 
QuestionASP.Net Best Practices Pin
DotnetCoders0012-Feb-14 5:10
DotnetCoders0012-Feb-14 5:10 
AnswerRe: ASP.Net Best Practices Pin
Snehasish_Nandy2-Feb-14 19:12
professionalSnehasish_Nandy2-Feb-14 19:12 
GeneralRe: ASP.Net Best Practices Pin
Richard MacCutchan2-Feb-14 22:00
mveRichard MacCutchan2-Feb-14 22:00 
AnswerRe: ASP.Net Best Practices Pin
thatraja2-Feb-14 20:35
professionalthatraja2-Feb-14 20:35 
AnswerRe: ASP.Net Best Practices Pin
Kornfeld Eliyahu Peter2-Feb-14 22:14
professionalKornfeld Eliyahu Peter2-Feb-14 22:14 
QuestionProblems with Profiles ... Pin
Promised_Coming2-Feb-14 0:20
Promised_Coming2-Feb-14 0:20 
AnswerRe: Problems with Profiles ... Pin
Prasad Vj2-Feb-14 1:35
professionalPrasad Vj2-Feb-14 1:35 
AnswerRe: Problems with Profiles ... Pin
Richard Deeming3-Feb-14 2:20
mveRichard Deeming3-Feb-14 2:20 
QuestionBest Practise Pin
abhi_24311-Feb-14 16:55
professionalabhi_24311-Feb-14 16:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.