Question: i am looking for a best jquery modal for use in asp.net with c# project in vs 2010...

so i found [Simple Modal By Eric](http://www.ericmmartin.com/projects/simplemodal/) , But I Had some problems with it in ajax mode...

because that project works perfect in php & it seems does not support ajax in asp.net!

would u plz show us a nice modal jquery and learn us how can we keep it alive during postbacks ...

i want to use it as login page !

thanks for attention

best regards

Answer: 
From the looks of things, you can make Simple Modal work using its most basic invocation. It sounds like you're using ASP.NET WebForms so you could do something like this:

MyPage.aspx

```
...
<asp:Button ID="btnPopupTrigger" runat="server" OnClick="OpenPopup" Text="Open Popup" />
...
<asp:Panel ID="pnlPopup" runat="server" CssClass="pnlPopup" Visible="false">
    <asp:TextBox ID="txtInput" runat="server" />
    ...
</asp:Panel>

<script type="text/javascript">

$("div.pnlPopup").modal();

</script>
...

```

MyPage.aspx.cs

```
...
protected void OpenPopup(object sender, EventArgs e)
{
    pnlPopup.Visible = true;
}
...

```

What this will do is hide the popup content until you want it to be shown. Once the asp:Panel is made visible, the jQuery will find it and make use of the SimpleModal plugin to make it display appropriately. This all requires that you're using standard postbacks, no asp:UpdatePanels or AJAX calls.

One issue you may run into is that it looks like this plugin grabs the modal content and appends it to the `<body>` element. ASP.NET expects to see those modal inputs within its `<form>`, so you might need to tweak the plugin to append the modal to `<form>` instead of `<body>`.
PHP and asp.net live on the server, what they both send to the browser is html, and it makes no difference what was used to generate that output. If something works with output generated with PHP, it should work with the same output generated by whatever other server-side script. This means, your problem (which you have not described) is *not* asp.net vs. PHP. soIn other words, if you switch to another modal plugin, it will not work either.

It is better to describe what problem you are having. Then, it would be possible to provide better help.