I have an ASP.Net page that has a script:#
var Show;
$(document).ready(function () {
...Set fooDialog to autoOpen=false
...Open the dialog on fooLink.Click
if(Show){
...Open the dialog
}
The behaviour is that this modal dialogue is hidden by default when the user opens the page. Then when they click fooLink it is opened. They enter some text which goes into a grid and close it and it is hidden again.
Now when the user clicks Edit on that row in the grid I want to show that dialog with the values.
When the user selects to edit the row we invoke the code behind:
protected void foo_RowEditing(object sender, GridViewEditEventArgs e)
{
...fill in the values in the dialog
...ClientScript.RegisterStartupScript(this.Page.GetType(), "webMethod", String.Format("<script>SetShowFooDialog()</script>"));
}
The problem is that the function to Open the fooDialogue is called by the code behind and then the $(document).ready(function () is called and overrides it setting the dialogue to hidden. So in effect we load it and then hide it as we are reloading the page on the client.
Is there any way around this?
In ready(function ()… hide dialog only when blnFlagDialog = false; is global javascript variable.
update this register script statment and reset the flag after it as i did