Hello. Is it available to open jquery Dialog Server Side From Behind Code in asp.net? Please give me an example or a link for more information. thanks.
+1
A:
You could use the RegisterStartupScript method from the code behind:
public void SomeButton_Click(Object sender, EventArgs e)
{
string script = "$('#someid').dialog('open');";
ClientScript.RegisterStartupScript(GetType(), "popup", script, true);
}
But mixing javascript and c# code is a very clean approach. It would be better to simply open the dialog from javascript on the client.
Darin Dimitrov
2010-10-23 10:33:47
Thanks. So I want to show Dialog after Postback. Is it possible? thanks
shaahin
2010-10-23 10:39:52
You could use the `$(document).ready` function but include it only if it is a postback: `<% if (IsPostBack) { ... %>`
Darin Dimitrov
2010-10-23 10:43:20