Help On Link Button With POP Up

Posted by Vijayar under ASP.NET on 2/3/2012 | Points: 10 | Views : 4795 | Status : [Member] | Replies : 2
HI\
I am displaying a list of events in a repeater along with link button.On click of link button i need to open a popup which shows particular item details.How to do this

vijaya


Responses

Posted by: SheoNarayan on: 2/3/2012 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Under ItemTemplate write like below apart from other content you want to display

<ItemTemplate>

<a href="javascript:ShowPopup(<%# Eval("AutoId") %>)">Show Details</a>
</ItemTemplate>


Then create a ShowPopup javascript function that accepts "AutoId" as parameter and in that function open a popup with the show details page that accepts a parameter something like this

<script type="text/javascript">

function ShowPopup(id) {
window.open('ShowDetails.aspx?id=' + id, "showdetails", "scrollbars=no,resizable=no,width=400,height=280");
}
</script>

On the ShowDetials.aspx page, retrieve the id querystring something like this

int id = int.Parse(Request.QueryString["id"]);


Use this id to retrieve the details about the record and show it on the page (To show the record details you can use DetailsView control (read more about it http://www.dotnetfunda.com/articles/article1657-how-to-show-a-record-using-detailsview-in-aspnet.aspx ).

Hope this helps.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 2/3/2012 [Member] Silver | Points: 25

Up
0
Down
very nice

Thanks,
Sanjay

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response