Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
ASP.NET 2.0 / 3.5 / 4.0
Apertura popup da gridview
domenica 18 maggio 2008 - 14.50
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
squilibrio
Profilo
| Expert
527
messaggi | Data Invio:
dom 18 mag 2008 - 14:50
Ciao a tutti, sto facendo mille prove per caricare una popup utilizzando il valore di un DDL della riga del gridview
ho fatto questo
protected void gwElenco_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList ddlProssimaOwner = (DropDownList)e.Row.FindControl("ddlProssimaOwner");
Helper.PresentationHelper.FillWithOwner(ddlProssimaOwner.Items, sqlConnection);
ddlProssimaOwner.Items.Insert(0, new ListItem("Seleziona...", null));
}
}
protected void gwElenco_RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
{
ImageButton btnCalendar = (ImageButton) e.Row.FindControl("btnCalendar");
DropDownList ddl = (DropDownList) e.Row.Cells[1].FindControl("ddlProssimaOwner");
btnCalendar.Attributes.Add("onlick","javascript:window.open('AgendaPopup.aspx?IDOwner=" + ddl.SelectedValue + "','Dettaglio','width=500, height=500, menubar=no, scrollbars=yes, resizable=yes');");
}
}
due problemi:
non accade nulla al click dell'immagine
al postback (dopo il click dell'immagine) visualizzo
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 61: DropDownList ddlProssimaOwner = (DropDownList)e.Row.FindControl("ddlProssimaOwner");
Line 62:
Line 63: Helper.PresentationHelper.FillWithOwner(ddlProssimaOwner.Items, sqlConnection);
Line 64: ddlProssimaOwner.Items.Insert(0, new ListItem("Seleziona...", null));
Line 65:
e se per ipotesi tolgo quelle righe dal metodo RowCreated, quando clicco sull'immagine non viene aperto nulla, non accade nulla
cosa sbaglio?
Grazie
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !