Pop out msgbox

P

Phoebe.

Sub DataGrid_ItemCreated(ByVal Sender As Object, ByVal e As
DataGridItemEventArgs)
Select Case e.Item.ItemType
Case ListItemType.Item, ListItemType.AlternatingItem,
ListItemType.EditItem
Dim myDeleteButton As LinkButton
Dim myTableCell As TableCell
myTableCell = e.Item.Cells(6) ' Delete Link column
myDeleteButton = myTableCell.Controls(0)
myDeleteButton.Attributes.Add("onclick", "return confirm('Are
you sure to delete?');")
End Select
End Sub

Hi, Good Day!

Above is the coding where i pop out a delete msgbox for user to either
delete a record from the datagrid. My records consist of User id, user name
and user nric.
Is there a way to show the user detail in the pop out delete msgbox as well
before user delete those record?

Can someone help?
Thanks in advanced.

rgds,
Phoebe.
 
J

James Crowley

What do you mean by "user detail"? You could add information to the text
in the message containing info about the row that would be deleted, by
just accessing the e.Item object.
 
K

Kevin Spencer

/// <summary>
/// Adds a JavaScript "alert()" with strMessage to Page Startup
/// </summary>
/// <param name="strMessage">Message to display</param>
public static void MsgBox(string strMessage)
{
StringBuilder s;
System.Web.UI.Page p;
if (HttpContext.Current == null) return;
s = new StringBuilder("<script type=\"text/javascript\">" +
Environment.NewLine +
"<!--" + Environment.NewLine);
s.Append("alert('" + strMessage.Replace("\"", "\\\"") + "');" +
Environment.NewLine + "// --></script>");
p = (System.Web.UI.Page) HttpContext.Current.Handler;
if (!(p.IsStartupScriptRegistered("MsgBox")))
p.RegisterStartupScript("MsgBox", s.ToString());
}

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

bassil said:
Yes , You can try this one :

MessageBox for ASP.NET from http://www.bassilsoft.com

There is a samples in the package could meet your need. Please download it
to see the source code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top