• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

dont want function to execute

function onButtonClicked(sender, args)
            {
                var commandName = args.get_item().get_commandName();
                if (commandName == "message")
                 {
                    onWindowLoad(<%= RadToolBar1.ClientID %>, ""); <-------what can I write here that wont throw and error on that function.. I need onWindowLoad  shouldnt execute if commandName is message...
                 }  
               
            }

            function onWindowLoad(sender, args)
            {              
                var html = "<br /><br /><br /><hr />" +
                                    "<strong>From:</strong> " + $get("from").innerHTML + "<br />" +
                                    "<strong>Sent:</strong> " + $get("sent").innerHTML + "<br />" +
                                    "<strong>Subject:</strong> " + $get("subject").innerHTML + "<br />" +
                                    $get("message-body").innerHTML;
                sender.get_contentFrame().contentWindow.setEditorContent(html);                
            }
0
1jaws
Asked:
1jaws
  • 5
  • 2
1 Solution
 
leakim971PluritechnicianCommented:
> I need onWindowLoad  shouldnt execute if commandName is message...

So it should be :  if (commandName == "message")
instead :  if (commandName != "message")
0
 
1jawsAuthor Commented:
well, my radwindow opens up on OnClientPageLoad="onWindowLoad" so that is getting executed what I need what code I can put that while that function executes it wont throw and error.. because I really dont want to get the html content out of that function for that paticular commandname executed...
0
 
1jawsAuthor Commented:
I need that function return no html ...basically.. so do Ineed to pass a "" or null or something?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
leakim971PluritechnicianCommented:
function onWindowLoad(sender, args)
{            
          if(sender != null ) {
 
                var html = "<br /><br /><br /><hr />" +
                                    "<strong>From:</strong> " + $get("from").innerHTML + "<br />" +
                                    "<strong>Sent:</strong> " + $get("sent").innerHTML + "<br />" +
                                    "<strong>Subject:</strong> " + $get("subject").innerHTML + "<br />" +
                                    $get("message-body").innerHTML;
                sender.get_contentFrame().contentWindow.setEditorContent(html);                
         }
 }

so you can use : onWindowLoad(null, null);
0
 
1jawsAuthor Commented:
ok, I think you understood what I meant :) .. tried to code still can see the html content... passing null should have take care but didnt...for some reason by the way, sender of onwindowload is  radwindow...
0
 
1jawsAuthor Commented:
I debugged... first this function function onButtonClicked(sender, args)  gets executed and we are passing null, null values.. which is ok and goes to function onWindowLoad(sender, args) ... this steps ok.. but than I noticed, function onWindowLoad(sender, args) gets executed again and this time sender is not null which is radwindow.. so still gives me html back....
0
 
1jawsAuthor Commented:
thanks for trying to help.. got that work differently...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now