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
C

compninja25

@compninja25
About
Posts
71
Topics
19
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • weird javascript issues
    C compninja25

    Ah, turns out that wasn't it after all. If I remove the image.onload section, then it works, although it never changes to the desired image after it loads. I guess it's coming back to the 'onload' function after Current has hit 5 and that's where it's bombing out. I'll have to search for dynamic image.onload functions. So far, I've been basing my code from this [Update] it is definately something to do with the image.onload event. I was able to finally step through the code and it does work fine, but it appears that after the function completes, it then goes off and works on the rest of the page before coming back to the code in the image.onload event. Then, it tries to execute those lines of code but fails because the image_Counter is now 5. I thought that the image.onload would be setting a new function for each image box, but instead it looks like that is not the case. The overall goal is to have a "loading" gif display as the thumbnails are loading, but then display the image once it is properly loaded. I can get it to work just fine with a single static image, but not programatically for each of the thumbnails. Does anyone have any recommendations to help point me in the right direction?

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    modified on Monday, November 9, 2009 3:49 PM

    Web Development help javascript css data-structures tutorial

  • weird javascript issues
    C compninja25

    I think I got it figured out.   Although I'm setting the variable as an interger, I still need to use 'parseInt()' on all of my "current" variables that deal with any sort of logic gate.   Is there a way you can specify a variable in javascript so that I don't need to use 'parseInt()' every time?

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    Web Development help javascript css data-structures tutorial

  • weird javascript issues
    C compninja25

    <pre> function scroller_set(direction) {             var imageObjects = new Array();             imageObjects = grabObjects();             var images = document.getElementsByName("selector");             var Current = parseInt(document.getElementById("scroller_current_value").value);                         var image_counter = 0;             if ((direction == "next") && (Current < imageObjects.length)) {                   document.getElementById('backButton').style.visibility = 'visible';             var stopValue = Current + 5;             while (Current < stopValue) {                   if (Current < imageObjects.length) {                         var imageLoader = new Image();                      //   images[image_counter].className = "loading";                         images[image_counter].src = "/designElements/interfaceImages/loading26.gif";                         imageLoader.onload = function() {                      //         images[image_counter].className = "images";                                                            images[image_counter].src = "/Gallery/Images/thumbs/" + imageObjects[Current].url;                         }                         imageLoader.src = "/Gallery/Images/thumbs/" + imageObjects[Curren

    Web Development help javascript css data-structures tutorial

  • weird javascript issues
    C compninja25

    Yea, that still does the same thing :/ it's just weird!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    Web Development help javascript css data-structures tutorial

  • Problem in Table Designing
    C compninja25

    for lines where your dynamically adding the values of the database, use the ToString() method, but not for the literals: rhtbhegade wrote: strHTMLContent.Append("<table align='Center'>".ToString()); strHTMLContent.Append("<tr>".ToString()); strHTMLContent.Append("<td style='width: 300px'></td>".ToString()); should read:

    strHTMLContent.Append("<table align='Center'>");
    strHTMLContent.Append("<tr>");
    strHTMLContent.Append("<td style='width: 300px'></td>");

    Then at the very end of the once your datareader is finished, convert the string builder to a sting.

    HttpContext.Current.Response.Write(strHTMLContent.ToString());

    Hope this helps! :) [update] You'll also want to inject the dynamic stuff inside the table data elements:

    strHTMLContent.Append("<table align='Center'><tr>");
    strHTMLContent.Append("<td style='width: 300px'>" + odr["AreaId"].ToString() + "</td>");

    that's probably most likely why it's not coming out in the 'grid' form you were expecting.

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    modified on Friday, November 6, 2009 3:14 PM

    ASP.NET html help

  • weird javascript issues
    C compninja25

    Hi Marc, Thank's for the reply! I don't believe so. I wasn't thinking at the time but a few lines up in the code that I didn't copy I am initalizing 'Current' and setting it equal to whatever I have saved in my hidden variable. I have since changed it to a 'while' block instead:

    while (Current < stopValue) {

    It's just so weird though... I put an 'alert' line displaying both values in right after the while block and sure enough, I can watch it as it counts: (Current = 3; stopValue = 5, Current = 4; stopValue = 5, Current = 5; stopValue = 5) but rather than stopping like I thought it should, it continues through the while statement and causes the problem. (because I have a set amount of elements and when it tries to find that 5th element it comes back null. I understand the easiest fix I'm sure is to just subtract 1 from the stop value, but I would still like to discover why the function is seeing 5 < 5 as true?

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    Web Development help javascript css data-structures tutorial

  • weird javascript issues
    C compninja25

    Hi Guys, I'm not sure what I did, but I cannot figure out how to fix it. For some reason, my comparison operator isn't doing what it should be doing.

    var Current = parseInt(document.getElementById("hiddenvalue").value);
    var stopValue = Current + 5;
    for (Current; Current < stopValue; Current++) {

    I have 5 elements in an array, so I have it setup to perform a function until it detects that the current value is no longer less than the stop value. What's really weird is, that it seems to be acting more like <= than just <. It still runs when current = 5. I don't think it's a problem with variable types because I can replace stopValue with 5 or even 4 but it will still run when the current value is equal to the stop value. when Current is equal to 5, shouldn't that stop because current < stopValue is no longer true? Another problem I am having is with changing the class after an image load:

    var imageLoader = new Image();
    images[image_counter].className = "image_loading";
    images[image_counter].src = "/designElements/interfaceImages/loading26.gif";
    imageLoader.onload = function() {
    images[image_counter].className = "images";
    images[image_counter].src = "/Gallery/Images/thumbs/" + imageObjects[Current].url;
    }
    imageLoader.src = "/Gallery/Images/thumbs/" + imageObjects[Current].url;

    does anyone see anything obvious that I'm missing? Thanks! the class does change initally to the image_loading class, but never seems to change back after the onload completes.

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    Web Development help javascript css data-structures tutorial

  • javascript setTimeout and return logic
    C compninja25

    oh that is cool! To be honest I've never really looked into jQuery but you're right. It'll probably make most sense to just use that animate function they have. Thanks!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    Web Development csharp javascript visual-studio debugging tools

  • javascript setTimeout and return logic
    C compninja25

    Hi guys! I can't figure out what the heck I'm doing wrong. I'm making a (hoping to at least) simple function that will take a white border and fade it to black on a mouseOver. Here's what I have so far:

    <script type="text/javascript">
    function animation(object, direction, number) {
    if (!number) {
    if (direction == "out") number = 255;
    if (direction == "in") number = 0;
    }

          var color = "rgb(" + number + "," + number + "," + number + ")";
          object.style.borderColor = color;
          
                    
          if (direction == "out") {
              if (number == 0) return;
                  
              var newNumber = number - 1;
              window.setTimeout(animation(object, direction, newNumber), 500);
          }
          
          if (direction == "in") {
              if (number == 255) return ;
              
              var newNumber = number + 1;
              window.setTimeout(animation(object, direction, newNumber), 500);                       
          }
      }
    

    </script>

    Now, what happens (when I use the debugger in visual studio 2008), the function executes correctly until the number variable gets to 255. At 255, the system does see the if (number == 255) return; part and appears to execute it. What happens after that when I hit F11 to continue stepping into the code, it jumps down to the window.setTimeout line again and tell's me there's an invalid argument. What's really weird, is that the number variable has now gone back to 254! I've even tried changing the if statement to stop at 250 and other various numbers, but it still seems to subtract a number and then give me the failure insted of stopping execution. Looking at other setTimeout examples, I also tried different syntax including wrapping the function in quotes, but this is the only way I've been able to get it to actually call the function. Wrapping it in quotes seems to just jump to the next line and return. I'm still fairly new to javascript, so I wouldn't doubt that there's something wrong with the flow of my logic, but I'm to the point where I feel like I'm not getting anywhere. Hopefully another set of eyes might see what's not obvious to me. Thanks!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    Web Development csharp javascript visual-studio debugging tools

  • Problem with post back validation
    C compninja25

    Ah, after looking at this http://forums.asp.net/t/945348.aspx I did find that it's a drop down list control causing the error. The control appears to be alright, but because I'm adding option values using javascript that's what's causing the invalid argument error. I'm still curious if there's a way using the debugger I could have found out which "argument" or control post back was causing the error quicker. Anyone have any suggestions? Thanks!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    ASP.NET help question javascript debugging

  • Running with 64 bit
    C compninja25

    Check this link out: http://support.microsoft.com/kb/894435 I switched my internal sites over to x64 a few months back without any major problems. The only thing I remember that seemed a little tricky to me was the web service extensions. The 32bit dot net and 64bit dot net were actually listed seperatly, so after switching it over remember to enable the 64 bit or it will fail.

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    ASP.NET visual-studio sysadmin question

  • Control to use
    C compninja25

    I don't know if I am interperting the question correctly, but on occasion for projects that involve having different pictures and text for users/products I use a panel or div control and then just dynamically place the controls per each data row in there. So, assume I have a panel control named "panel1" on the aspx file, I would then use something like this in my code behind:

    DataReader dr1 = Connection1.Read()

    While (dr1.Read)
    {
    Image pictureBox1 = new Image();
    TextBox tb1 = new TextBox();

    pictureBox1.ImageURL = dr1["imageLocation"].toString();
    tb1.Text = dr1["textBlurb"].toString();

    panel1.Controls.Add(pictureBox1);
    panel1.Controls.Add(tb1);
    }

    Then I just work on formatting the layout using the css. Hope this helps! :)

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    ASP.NET question css learning

  • Problem with post back validation
    C compninja25

    I'm having quite the bizzare issue. I created a page a while ago which validates my form using javascript and if everything looks good, then it issues a post back passing the 'submit_button' as the posting control and 'validated' as the argument. This works just fine, however I copied the page to a new form and made some slight modifications to the javascript, images, and layout on the page, however both pages are using the same "validate_form" function but the new page that I copied over always throws the "invalid post back or callback argument". I've scoured the net for the better part of this day and have come across the clientscript.RegisterForEventValidation method but cannot seem to get that to work. But...again what is bizzare is why it's not giving me this error on the first page I made months ago as there's no code disabling the validation for the page. I've tried this so far, but still get the error:

    protected override void Render(HtmlTextWriter writer)
    {
    this.ClientScript.RegisterForEventValidation("submit_button", "validated");

            base.Render(writer);
        } 
    

    What's also weird is when I debug on the Page_Init event, I can look at the live "Validators" collection but even after the RegisterForEventValidation() executes, I still get a collection count of zero. Am I looking in the wrong place? Thanks!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    ASP.NET help question javascript debugging

  • Extracting innerHTML from a div elements that contains dynamic controls
    C compninja25

    Oh, so then you could write a method to say, format or parse strings, Dictonaries<>, Lists, ect and using a generic, pass the method anything and let it figure out what it is?

    bool myMethod(T Object) Where T : Object {}

    I'm a self-taught programmer and I've read the whole way through Head First C# (which I really enjoyed and learned a lot), but I don't recall seeing anything about generics....Or if I did, obviously it didn't sink in. I'll have to go back and review that tonight. Thank's again for all your help!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    ASP.NET html sysadmin help question

  • Extracting innerHTML from a div elements that contains dynamic controls
    C compninja25

    Hi Navaneeth, Thanks! I do remember seeing the RenderControl in the intellisense, but it never dawned on me to look into that method! I thought it would be "ClientOutput" or something like that. I did have a quick question, though. Can you tell me what this line is saying?

    string GetRenderedOutput<T>(T control) where T : Control

    I understand Where T is inherenting from the Control class, but I've never seen <t>(T Control) before. Thanks Again!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    modified on Monday, September 28, 2009 12:22 PM

    ASP.NET html sysadmin help question

  • Extracting innerHTML from a div elements that contains dynamic controls
    C compninja25

    Hi Everyone, I was curious if it's possible to grab the HTML that a client would receive after the server processes a bit of code. I'm building a web app that will need to send an e-mail notification to the end user. I've already created the dynamic code and display the confirmation on the screen, but what I would like to do is something like this:

    MailMessage.Body = Confirmation_div.InnerHtml.ToString();

    This way, I can simply email all of the items without having to rebuild the message body html. This bit of code gives me an error indicating that the server can't grab the innerHTML because the div element isn't using any literal controls. Is there a way to convert all of the dynamic controls (after the values have been designated) to literal controls, or somehow grabbing the HTML equilavent that will be sent to the client during the PAGE_PreRender or something? Thanks!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    ASP.NET html sysadmin help question

  • gridview delete row event firing twice?
    C compninja25

    Hi Greg, Thank's for the work around. I was googling it again and found this article: forums.asp.net Looks like there is a known bug when using an image instead of a regular text hyperlink! I would have never guessed that!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    ASP.NET help csharp css asp-net database

  • How dynamic objects work during a post back
    C compninja25

    Hello abhijit, Thank you for your input. Do you have any suggestions regarding tutorials or white papers on the page life cycle? I've read through this one click here , but the whole concept is still quite foreign to me. I believe that's why I'm running into this problem; because I cannot yet visualize the 'flow' of the page. Thanks!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    ASP.NET sysadmin help question

  • How dynamic objects work during a post back
    C compninja25

    Hi Navaneeth, Indeed, it is tabular data. I've done what you are suggesting before with much larger amounts of data, but because in general the task at hand is only calling for 2 through 5 options to display to the user, I originally thought it would be quicker to just build a quick table and add the few rows. Anyhoo, I did consider using the data grid, but figured I'd like to look into trying to get the dynamic control working first as a way to learn more about the page life cycle and view state. Hopefully it will come in handy somewhere down the line! :) Thanks again for your response!

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    ASP.NET sysadmin help question

  • how to update elements in modal popup by using java script
    C compninja25

    Hey Zapss, Great! I probably skimmed through the question too quickly, but I wasn't sure what type of control you were using. I just remember having an asp:label control one time and the .value would not change! I then stumbled across an article where someone mentioned that the label is putting a "" tag on the html and you need to use innerHTML to change what is displayed.

    Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

    ASP.NET java javascript css tools help
  • Login

  • Don't have an account? Register

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