How to show grid view selected record in AJAX POP UP window?


In this article I have explained about how to show grid view selected record details in AJAX POP UP window. In this example application I used student table for bind details in Grid view. If user click the student id on the grid view that student details fetched in the AJAX POP UP window and if user click update button that details are updated in the SQL Server table based on the user entered details.

How to create POP up window content in client side?
You can easily created pop up window content inside of the panel control. Here I want to display student details so I write code in panel-"PnlModal"

How to control AJAX POP up window color and Back Ground color?
You can mention that color details in the style sheet and call that style sheet code in the panel. Style sheet like this.
client side


.modalBackground
{
background-color: Gray;
filter:alpha(opacity=70);
opacity:0.7;
}
.modalPopup
{
background-color:#ffffdd;
border-width:3px;
border-style:solid;
border-color:Gray;
padding:3px;
width:250px;
}

How to open AJAX POP UP window during user click that student id?
Here I wrote code inside of row command event because where ever user click grid view link button then that student id passed and show details in pop up window.

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "cmdBind")
{
LinkButton lb = (LinkButton)e.CommandSource;
ModalPopupExtender1.Show();
GetData(lb.Text);
}
}

Source Code Detail:
Here with I have attached source code to show student detail in AJAX POP up window. Download it and try to learn AJAX POP UP Concept.
Front End : ASP.NET
Code Behind : C#

Conclusion:
I hope this Article is help to you understand AJAX POP UP control.


Attachments

  • GridView_AJAXPOPUP (42889-29937-AJAXPOPUP.rar)
  • Comments

    Author: nagesh07 Jul 2011 Member Level: Silver   Points : 1

    yes ravindran, the article is so good but, i want to display
    dropdown list in popup., and dependency popouts also that means when i select one dropdownlist in popup the dependent dropdownlist should reload.

    for ex. if am hving counties dropdownlist and am selected india
    then second dropdown of popup should display states of india.
    Thank you,
    nagesh.



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: