Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. LinkButton cann't work [modified]

LinkButton cann't work [modified]

Scheduled Pinned Locked Moved ASP.NET
csharphelpjavascripttoolstutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sohighthesky
    wrote on last edited by
    #1

    I don't know why all the LinkButton in my C#.net website cann't work, It means that if i clicked the button just like i have nothing to do with it. Can someone help me?waiting online the browser has not any problem. Now i know what cause this problem,but i don't know how to solve. my website reference a outside javascript file,the file content is:

    // JScript 文件
    var imgObj;
    function showImage(imgsrc)
    {
    if(imgObj!=null) {
    document.body.removeChild(imgObj);
    }
    imgObj=document.createElement("div");//消息层
    imgObj.setAttribute("id","imgDiv");
    imgObj.setAttribute("align","center");
    imgObj.style.border="0";
    imgObj.style.position="absolute";
    var X=event.x;
    if(X<=screen.width*41/100)
    X=X+100;
    else if(X>=screen.width*59/100)
    X=X-200-350;
    else
    X=screen.width*59/100;
    imgObj.style.left=X;
    imgObj.style.top="30%";
    imgObj.style.marginTop=-75+document.documentElement.scrollTop+"px";
    imgObj.style.zIndex="1000";
    imgObj.innerHTML="<img src='"+imgsrc+"' onerror='return true' height=400 width=350 />";
    document.body.appendChild(imgObj);
    }
    function hideImage()
    {
    document.body.removeChild(imgObj);
    imgObj=null;
    }

    this script is to show the bigger image onmouseover,but i don't know why it can cause this problem.

    modified on Saturday, March 14, 2009 10:05 PM

    N C 2 Replies Last reply
    0
    • S sohighthesky

      I don't know why all the LinkButton in my C#.net website cann't work, It means that if i clicked the button just like i have nothing to do with it. Can someone help me?waiting online the browser has not any problem. Now i know what cause this problem,but i don't know how to solve. my website reference a outside javascript file,the file content is:

      // JScript 文件
      var imgObj;
      function showImage(imgsrc)
      {
      if(imgObj!=null) {
      document.body.removeChild(imgObj);
      }
      imgObj=document.createElement("div");//消息层
      imgObj.setAttribute("id","imgDiv");
      imgObj.setAttribute("align","center");
      imgObj.style.border="0";
      imgObj.style.position="absolute";
      var X=event.x;
      if(X<=screen.width*41/100)
      X=X+100;
      else if(X>=screen.width*59/100)
      X=X-200-350;
      else
      X=screen.width*59/100;
      imgObj.style.left=X;
      imgObj.style.top="30%";
      imgObj.style.marginTop=-75+document.documentElement.scrollTop+"px";
      imgObj.style.zIndex="1000";
      imgObj.innerHTML="<img src='"+imgsrc+"' onerror='return true' height=400 width=350 />";
      document.body.appendChild(imgObj);
      }
      function hideImage()
      {
      document.body.removeChild(imgObj);
      imgObj=null;
      }

      this script is to show the bigger image onmouseover,but i don't know why it can cause this problem.

      modified on Saturday, March 14, 2009 10:05 PM

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      1 - See the event handlers are hooked correctly. 2 - Take the viewsource of that page and see how it is rendered. 3 - Make sure you have JS enabled browser. :)

      Navaneeth How to use google | Ask smart questions

      1 Reply Last reply
      0
      • S sohighthesky

        I don't know why all the LinkButton in my C#.net website cann't work, It means that if i clicked the button just like i have nothing to do with it. Can someone help me?waiting online the browser has not any problem. Now i know what cause this problem,but i don't know how to solve. my website reference a outside javascript file,the file content is:

        // JScript 文件
        var imgObj;
        function showImage(imgsrc)
        {
        if(imgObj!=null) {
        document.body.removeChild(imgObj);
        }
        imgObj=document.createElement("div");//消息层
        imgObj.setAttribute("id","imgDiv");
        imgObj.setAttribute("align","center");
        imgObj.style.border="0";
        imgObj.style.position="absolute";
        var X=event.x;
        if(X<=screen.width*41/100)
        X=X+100;
        else if(X>=screen.width*59/100)
        X=X-200-350;
        else
        X=screen.width*59/100;
        imgObj.style.left=X;
        imgObj.style.top="30%";
        imgObj.style.marginTop=-75+document.documentElement.scrollTop+"px";
        imgObj.style.zIndex="1000";
        imgObj.innerHTML="<img src='"+imgsrc+"' onerror='return true' height=400 width=350 />";
        document.body.appendChild(imgObj);
        }
        function hideImage()
        {
        document.body.removeChild(imgObj);
        imgObj=null;
        }

        this script is to show the bigger image onmouseover,but i don't know why it can cause this problem.

        modified on Saturday, March 14, 2009 10:05 PM

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        sohighthesky wrote:

        the browser has not any problem.

        No, the odds seem low of the browser being broken. Your code obviously is. So, do some basic error checking, and if you need to ask again, try giving us some detail of what is happening, and show us code. This post is utterly useless. You've said to us 'my code is broken'. Great. How can we help without seeing it, or without you doing some basic work to check what is and is not working as you'd expect ?

        Christian Graus Driven to the arms of OSX by Vista.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups