0

It used to work but when I included a jquery-ui tab. It suddenly had an error in it .. So here's how I call it

Dim strCallScript As String = "$(function() { " & _
        "$('#dialog').dialog('open'); " & _
        "});  "
        ClientScript.RegisterStartupScript(Page.GetType(), "error", strCallScript, True)

And here is it's function

 $(function myFunction(){ 
            $( "#dialog" ).dialog({ 
                autoOpen: false,
                modal: true,
                buttons: {
                    OK: function() {
                        $(this).dialog("close");
                    }
                } 
            });                                                
        });           

And here is its div

<div id="dialog" title="Invalid Date Range" class="ui-dialog ui-widget ui-widget-content ui-corner-all"> 
                    <div class="ui-widget">
                        <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
                            <p>
                                <span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
                                Please enter starting date.
                            </p>
                        </div>
                    </div> 
                </div>   

And here is the error:

enter image description here

Please help. Thanks :)

3
  • 1
    why not inserting the javascript into the asp pages rather than code behind? Commented Feb 15, 2013 at 6:46
  • I have a condition before it must appear. For it is enclosed in an if statement sorry I was not able to say that Commented Feb 15, 2013 at 6:47
  • 1
    In Dim ....you missed :"javascript:myFunction();" For more you may refer to stackoverflow.com/questions/788330/… Commented Feb 15, 2013 at 6:57

1 Answer 1

0

This was my mistake :)

Dim strCallScript As String = "$(function myFunction(){ " & _
        "$(function() { " & _
        "$('#dialog').dialog('open'); " & _
        "});  " & _
        "});  "

    ClientScript.RegisterStartupScript(Page.GetType(), "error", strCallScript, True)

That was how it was supposed to be

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.